delete-deployment-environment
delete-deployment-environment copied to clipboard
example code is wrong on "ref:"
Hi all, In the example:
#
# Cleans up a GitHub PR
#
name: ๐งผ Clean up environment
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
# Points to a recent commit instead of `main` to avoid supply chain attacks. (The latest tag is very old.)
- name: ๐ Get GitHub App token
uses: navikt/github-app-token-generator@a3831f44404199df32d8f39f7c0ad9bb8fa18b1c
id: get-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: ๐ Delete deployment environment
uses: strumwolf/[email protected]
with:
# Use a JWT created with your GitHub App's private key
token: ${{ steps.get-token.outputs.token }}
environment: pr-${{ github.event.number }}
ref: ${{ github.ref_name }}
ref: ${{ github.ref_name }} is wrong, because ${{ github.ref_name }} return PR number not from source branch.
I change to ${{ github.head_ref }} and it works well.