Skip to content

example code is wrong on "ref:" #42

@mvn-bachhuynh-dn

Description

@mvn-bachhuynh-dn

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/delete-deployment-environment@v2.2.3
        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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions