Skip to content

Commit 7a7cd85

Browse files
committed
Don't push for PR event
1 parent fd830db commit 7a7cd85

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

.github/workflows/update-supported-enterprise-server-versions.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,33 @@ jobs:
5252
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
5353
git config --global user.name "github-actions[bot]"
5454
55-
- name: Commit changes and open PR
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Commit changes
56+
id: prepare-commit
5857
run: |
5958
if [[ -z $(git status --porcelain) ]]; then
6059
echo "No changes to commit"
60+
echo "committed=false" >> $GITHUB_OUTPUT
6161
else
6262
git checkout -b update-supported-enterprise-server-versions
6363
git add .
6464
git commit --message "Update supported GitHub Enterprise Server versions"
65-
git push origin update-supported-enterprise-server-versions
66-
67-
body="This PR updates the list of supported GitHub Enterprise Server versions, either because a new "
68-
body+="version is about to be feature frozen, or because an old release has been deprecated."
69-
body+=$'\n\n'
70-
body+="If an old release has been deprecated, please follow the instructions in CONTRIBUTING.md to "
71-
body+="deprecate the corresponding version of CodeQL."
7265
73-
gh pr create --draft \
74-
--title "Update supported GitHub Enterprise Server versions" \
75-
--body "$body"
66+
echo "committed=true" >> $GITHUB_OUTPUT
7667
fi
68+
69+
- name: Open PR
70+
if: github.event_name != 'pull_request' && steps.prepare-commit.outputs.committed == 'true'
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
git push origin update-supported-enterprise-server-versions
75+
76+
body="This PR updates the list of supported GitHub Enterprise Server versions, either because a new "
77+
body+="version is about to be feature frozen, or because an old release has been deprecated."
78+
body+=$'\n\n'
79+
body+="If an old release has been deprecated, please follow the instructions in CONTRIBUTING.md to "
80+
body+="deprecate the corresponding version of CodeQL."
81+
82+
gh pr create --draft \
83+
--title "Update supported GitHub Enterprise Server versions" \
84+
--body "$body"

0 commit comments

Comments
 (0)