delete-deployment-environment icon indicating copy to clipboard operation
delete-deployment-environment copied to clipboard

example code is wrong on "ref:"

Open mvn-bachhuynh-dn opened this issue 1 year ago โ€ข 0 comments

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.

mvn-bachhuynh-dn avatar Nov 24 '23 08:11 mvn-bachhuynh-dn