Skip to content

Commit ca23666

Browse files
authored
ci: update the token used in the CI workflows (#520)
* chore: disable staging/production locking * chore: update the github tokens used in the repo
1 parent 6b5a7de commit ca23666

File tree

4 files changed

+4
-40
lines changed

4 files changed

+4
-40
lines changed

.github/workflows/deploy-to-production.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ jobs:
1616
with:
1717
tag: ${{ inputs.tag }}
1818
environment: production
19-
lock: true
2019
secrets:
21-
DEPLOYMENT_GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_GITHUB_TOKEN }}
20+
DEPLOYMENT_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }}

.github/workflows/deploy-to-staging.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ jobs:
1616
with:
1717
tag: ${{ inputs.tag }}
1818
environment: staging
19-
lock: true
2019
secrets:
21-
DEPLOYMENT_GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_GITHUB_TOKEN }}
22-
20+
DEPLOYMENT_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,10 @@ on:
1111
description: 'Environment to deploy to'
1212
required: true
1313
type: string
14-
lock:
15-
description: 'Lock environment branch after deployment'
16-
required: false
17-
type: boolean
18-
default: false
1914
secrets:
2015
DEPLOYMENT_GITHUB_TOKEN:
2116
description: |
2217
A GitHub token with the following permissions:
23-
administration: write (optional; to be able to lock the environment branch)
2418
contents: write (required; to be able to push to the environment branch)
2519
workflows: write (required; to be able to modify .github/workflows)
2620
required: true
@@ -29,7 +23,7 @@ permissions: {}
2923

3024
jobs:
3125
deploy:
32-
name: Deploy
26+
name: Deploy ${{ inputs.tag }} to ${{ inputs.environment }}
3327
runs-on: ubuntu-latest
3428
environment: ${{ inputs.environment }}
3529
steps:
@@ -59,34 +53,7 @@ jobs:
5953
env:
6054
TAG: ${{ inputs.tag }}
6155
run: git reset --hard $TAG
62-
# TODO: Use repository rule sets instead of branch protection rules
63-
- name: Unlock environment branch
64-
if: inputs.lock == true
65-
env:
66-
ENVIRONMENT: ${{ inputs.environment }}
67-
GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_GITHUB_TOKEN }}
68-
run: |
69-
gh api --method PUT /repos/$GITHUB_REPOSITORY/branches/$ENVIRONMENT/protection \
70-
-F required_status_checks=null \
71-
-F enforce_admins=true \
72-
-F required_pull_request_reviews=null \
73-
-F restrictions=null \
74-
-F allow_force_pushes=true \
75-
-F lock_branch=false
7656
- name: Force push environment branch
7757
env:
7858
ENVIRONMENT: ${{ inputs.environment }}
7959
run: git push -f origin $ENVIRONMENT
80-
- name: Lock environment branch
81-
if: inputs.lock == true
82-
env:
83-
ENVIRONMENT: ${{ inputs.environment }}
84-
GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_GITHUB_TOKEN }}
85-
run: |
86-
gh api --method PUT /repos/$GITHUB_REPOSITORY/branches/$ENVIRONMENT/protection \
87-
-F required_status_checks=null \
88-
-F enforce_admins=true \
89-
-F required_pull_request_reviews=null \
90-
-F restrictions=null \
91-
-F allow_force_pushes=false \
92-
-F lock_branch=true

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ jobs:
178178
release-type: node
179179
# Use a token for creating the release-pr and git tags so that the `deploy` workflow can be triggered by them
180180
# see https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs and https://github.com/orgs/community/discussions/27028 for more information
181-
token: ${{ secrets.SGTPOOKI_PAT }}
181+
token: ${{ secrets.UCI_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)