Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,30 @@ jobs:
outputs:
version: ${{ steps.pre-publish.outputs.version }}
steps:
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v3
- name: Create app token
id: app-token
uses: actions/create-github-app-token@v3
with:
app_id: ${{ vars.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
permission-workflows: write
- name: Store token
shell: bash -eu {0}
# zizmor: ignore[template-injection] GH_TOKEN is a GitHub App installation token, not attacker-controllable
run: echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
- uses: actions/checkout@v7.0.1
with:
ref: ${{ github.ref }}
token: ${{ env.GH_TOKEN }}
fetch-depth: 1
persist-credentials: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop persist-credentials: false and Configure git auth for push because actions/checkout already writes the auth header so we don't need to not-save it and then re-create it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want the auth stored on disk

- name: Configure git auth for push
shell: bash -eu {0}
run: |
auth_header=$(printf 'x-access-token:%s' "${GH_TOKEN}" | base64 -w0)
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${auth_header}"
- uses: mongodb-labs/drivers-github-tools/setup@v3
with:
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
Expand Down
Loading