From c737d0940a7cc27f9a18c79d198ef77754d8d874 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Mon, 22 Apr 2024 16:07:09 +0200 Subject: [PATCH] added branch reference --- .github/workflows/cmd-action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmd-action.yml b/.github/workflows/cmd-action.yml index b8ffa438f172b..6b40b91feda16 100644 --- a/.github/workflows/cmd-action.yml +++ b/.github/workflows/cmd-action.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest outputs: commands: ${{ steps.cmd.outputs.commands }} + branch: ${{ steps.branch.outputs.branch }} name: Bot steps: - uses: actions/checkout@v4 @@ -21,6 +22,9 @@ jobs: with: commands-directory: ".github/commands" GITHUB_TOKEN: ${{ github.token }} + - name: Export branch name + run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT" + id: branch - name: Print commands if: ${{ github.event.issue.pull_request }} run: echo "Commands are $CMD" @@ -47,9 +51,8 @@ jobs: steps: - name: Download repo uses: actions/checkout@v4.1.1 - - run: gh pr checkout ${{ github.event.issue.number }} - env: - GITHUB_TOKEN: ${{ github.token }} + with: + ref: ${{ needs.cmd-check.outputs.branch }} - name: Generate script # Here it would get the script from previous step run: $COMMAND