Skip to content

Commit 91005da

Browse files
authored
chore: [REL-4161] use elevated token for git stuff (#562)
The GITHUB_TOKEN that's built-in to the GHA is not authorized to push directly to main. We need to do this in order to push up our committed changes to the remote repo so we can create the release. I had a new SSM parameter added that will allow this, so we should be able to cut the release now with this new token. I needed to get a little creative since the value is not known until after the `get secrets` step runs, but I think what I have here should work. <!-- ld-jira-link --> --- Related Jira issue: [REL-4161: Migrate ld-find-code-refs from Releaser to GHA](https://launchdarkly.atlassian.net/browse/REL-4161) <!-- end-ld-jira-link -->
1 parent b4da482 commit 91005da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626
LD_RELEASE_VERSION: ${{ inputs.releaseVersion }}
2727
DRY_RUN: ${{ inputs.dryRun || 'false' }}
2828
CHANGELOG_ENTRY: ${{ inputs.changeLog }}
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3029
HOMEBREW_GH_TOKEN: ${{ secrets.LAUNCHDARKLY_HOMEBREW_TAP_DEPLOY_KEY }}
3130
ARTIFACT_DIRECTORY: "/tmp/release-artifacts"
3231
steps:
@@ -37,7 +36,9 @@ jobs:
3736
uses: launchdarkly/gh-actions/actions/[email protected]
3837
with:
3938
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
40-
ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN, /production/common/releasing/circleci/orb-token= CIRCLECI_CLI_TOKEN, /production/common/releasing/bitbucket/username = BITBUCKET_USERNAME, /production/common/releasing/bitbucket/token = BITBUCKET_TOKEN'
39+
ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN, /production/common/releasing/circleci/orb-token= CIRCLECI_CLI_TOKEN, /production/common/releasing/bitbucket/username = BITBUCKET_USERNAME, /production/common/releasing/bitbucket/token = BITBUCKET_TOKEN, /production/common/releasing/ld-find-code-refs/github-release-token = GITHUB_RELEASE_TOKEN'
40+
- name: set release token
41+
run: echo "GITHUB_TOKEN=$GITHUB_RELEASE_TOKEN" >> $GITHUB_ENV
4142
- name: setup access for find-code-references
4243
uses: launchdarkly/gh-actions/actions/ssh-key-by-repo@main
4344
with:
@@ -72,7 +73,6 @@ jobs:
7273
uses: ncipollo/[email protected]
7374
if: ${{ !inputs.dryRun }}
7475
with:
75-
token: ${{ secrets.GITHUB_TOKEN }}
7676
tag: v${{ inputs.releaseVersion }}
7777
body: ${{ inputs.changeLog }}
7878
artifacts: ${{ env.ARTIFACT_DIRECTORY }}/*

0 commit comments

Comments
 (0)