1
1
name : Update Code of Conduct
2
2
3
3
on :
4
- push :
5
- pull_request :
4
+ # push:
5
+ # pull_request:
6
6
# Run every Sunday at midnight UTC (00:00) - triggered by webhook?
7
7
schedule :
8
8
- cron : ' 0 0 * * 0'
9
9
10
- permissions :
11
- contents : write
12
- issues : write
13
- pull-requests : write
10
+ # permissions:
11
+ # contents: write
12
+ # issues: write
13
+ # pull-requests: write
14
14
15
15
jobs :
16
16
update_code_of_conduct :
@@ -29,32 +29,22 @@ jobs:
29
29
run : |
30
30
if cmp -s fetched_code_of_conduct.md CODE_OF_CONDUCT.md; then
31
31
echo "No changes in CODE_OF_CONDUCT.md"
32
- echo "::set-output name= changed:: false"
32
+ echo "changed= false" >> $GITHUB_OUTPUT
33
33
else
34
34
echo "CODE_OF_CONDUCT.md has changed"
35
- echo "::set-output name= changed:: true"
35
+ echo "changed= true" >> $GITHUB_OUTPUT
36
36
fi
37
37
38
- # Step 4: Create a new branch and commit the updated file (if it changed)
39
- - name : Create branch and commit changes
40
- if : steps.check_changes.outputs.changed == 'true'
41
- run : |
42
- git config user.name "GitHub Actions Bot"
43
- git config user.email "[email protected] "
44
- git checkout -b update-code-of-conduct
45
- cp fetched_code_of_conduct.md CODE_OF_CONDUCT.md
46
- git add CODE_OF_CONDUCT.md
47
- git commit -m "Update CODE_OF_CONDUCT.md"
48
- git push origin update-code-of-conduct
49
-
50
- # Step 5: Create a pull request to merge the changes into the main branch
38
+ # Create a pull request to merge the changes into the main branch
51
39
- name : Create Pull Request
52
40
if : steps.check_changes.outputs.changed == 'true'
53
41
uses : peter-evans/create-pull-request@v7
54
42
with :
55
43
token : ${{ secrets.GITHUB_TOKEN }}
56
- branch : update-code-of-conduct
44
+ branch : update-coc
45
+ add-paths : |
46
+ CODE_OF_CONDUCT.md
57
47
title : " Update Code of Conduct"
58
- body : " This PR updates the Code of Conduct with the latest version from the django-commons repository."
48
+ body : " Update the Code of Conduct with the latest version from the django-commons repository."
59
49
base : main
60
50
commit-message : " Update CODE_OF_CONDUCT.md from django-commons"
0 commit comments