Skip to content

Commit 487024f

Browse files
ci: release automation follow-ups (self-pin push, remove deploy-key rotation reminder) (#645)
* ci: don't attempt gh pr create for self-pin (org blocks it) The Azure org permanently disables 'Allow GitHub Actions to create and approve pull requests', so gh pr create failed every release with a misleading 'PR may already exist' fallback. Remove the doomed call and instead print a ::notice:: with the compare link so the releaser opens the PR in one click. Also drop the now-unused pull-requests: write permission and GH_TOKEN env from the self-pin jobs (they only use git via the deploy key), and rename the step to 'push branch'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: send deploy-key rotation reminder to Teams instead of a public issue Azure/login is public, so a GitHub issue reminder to rotate the release deploy key is publicly visible. Post to a private Teams channel via a Power Automate 'Workflows' webhook (TEAMS_WEBHOOK_URL secret) instead. Needs no GitHub permissions (empty permissions block, no GITHUB_TOKEN) - the webhook URL is the only credential. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Delete deploy-key-rotation-reminder.yml --------- Co-authored-by: Maddison Das <272712104+MaddyMicrosoft@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 56d99fc commit 487024f

3 files changed

Lines changed: 8 additions & 51 deletions

File tree

‎.github/workflows/deploy-key-rotation-reminder.yml‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ jobs:
185185
environment: release
186186
permissions:
187187
contents: write
188-
pull-requests: write
189188
steps:
190189
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
191190
with:
@@ -194,9 +193,8 @@ jobs:
194193
fetch-depth: 0
195194
fetch-tags: true
196195

197-
- name: Bump azure/login self-references and open PR
196+
- name: Bump azure/login self-references and push branch
198197
env:
199-
GH_TOKEN: ${{ github.token }}
200198
V: ${{ inputs.version }}
201199
run: |
202200
SHA=$(git rev-parse "refs/tags/$V^{commit}")
@@ -218,8 +216,6 @@ jobs:
218216
# Force-push: this version-specific bot branch is safe to overwrite if a
219217
# prior run left it behind, and there is no other writer to protect.
220218
git push --force --set-upstream origin "$BRANCH"
221-
# Tolerate an existing PR for this branch (e.g. on a re-run) without failing.
222-
gh pr create --base master --head "$BRANCH" \
223-
--title "Pin azure/login self-references to $V" \
224-
--body "Automated post-release update: repoints \`azure/login@…\` in workflow files to the built release commit \`$SHA\` (\`$V\`)." \
225-
|| echo "PR for $BRANCH may already exist; skipping create."
219+
# The org blocks Actions from creating PRs, so open it manually from the
220+
# pushed branch. Print the compare link for the releaser.
221+
echo "::notice::Self-pin branch pushed. Open a PR: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/master...${BRANCH}?expand=1"

‎.github/workflows/rollback.yml‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ jobs:
115115
environment: release
116116
permissions:
117117
contents: write
118-
pull-requests: write
119118
steps:
120119
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
121120
with:
@@ -124,9 +123,8 @@ jobs:
124123
fetch-depth: 0
125124
fetch-tags: true
126125

127-
- name: Roll back azure/login self-references and open PR
126+
- name: Roll back azure/login self-references and push branch
128127
env:
129-
GH_TOKEN: ${{ github.token }}
130128
V: ${{ inputs.target_version }}
131129
run: |
132130
TARGET_MAJOR="${V%%.*}" # v3.0.1 -> v3
@@ -161,8 +159,6 @@ jobs:
161159
# Force-push: this version-specific bot branch is safe to overwrite if a
162160
# prior run left it behind, and there is no other writer to protect.
163161
git push --force --set-upstream origin "$BRANCH"
164-
# Tolerate an existing PR for this branch (e.g. on a re-run) without failing.
165-
gh pr create --base master --head "$BRANCH" \
166-
--title "Roll back azure/login self-references to $V" \
167-
--body "Automated post-rollback update: repoints \`azure/login@…\` in workflow files to the rolled-back release commit \`$SHA\` (\`$V\`)." \
168-
|| echo "PR for $BRANCH may already exist; skipping create."
162+
# The org blocks Actions from creating PRs, so open it manually from the
163+
# pushed branch. Print the compare link for the releaser.
164+
echo "::notice::Self-pin branch pushed. Open a PR: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/master...${BRANCH}?expand=1"

0 commit comments

Comments
 (0)