Skip to content

Commit 94b1e11

Browse files
committed
try update coc action
1 parent 34c23a1 commit 94b1e11

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

.github/workflows/update_coc.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: Update Code of Conduct
22

33
on:
4-
push:
5-
pull_request:
4+
# push:
5+
# pull_request:
66
# Run every Sunday at midnight UTC (00:00) - triggered by webhook?
77
schedule:
88
- cron: '0 0 * * 0'
99

10-
permissions:
11-
contents: write
12-
issues: write
13-
pull-requests: write
10+
# permissions:
11+
# contents: write
12+
# issues: write
13+
# pull-requests: write
1414

1515
jobs:
1616
update_code_of_conduct:
@@ -29,32 +29,22 @@ jobs:
2929
run: |
3030
if cmp -s fetched_code_of_conduct.md CODE_OF_CONDUCT.md; then
3131
echo "No changes in CODE_OF_CONDUCT.md"
32-
echo "::set-output name=changed::false"
32+
echo "changed=false" >> $GITHUB_OUTPUT
3333
else
3434
echo "CODE_OF_CONDUCT.md has changed"
35-
echo "::set-output name=changed::true"
35+
echo "changed=true" >> $GITHUB_OUTPUT
3636
fi
3737
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
5139
- name: Create Pull Request
5240
if: steps.check_changes.outputs.changed == 'true'
5341
uses: peter-evans/create-pull-request@v7
5442
with:
5543
token: ${{ secrets.GITHUB_TOKEN }}
56-
branch: update-code-of-conduct
44+
branch: update-coc
45+
add-paths: |
46+
CODE_OF_CONDUCT.md
5747
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."
5949
base: main
6050
commit-message: "Update CODE_OF_CONDUCT.md from django-commons"

0 commit comments

Comments
 (0)