diff --git a/.github/workflows/workflow-issue-status.yml b/.github/workflows/workflow-issue-status.yml index 7193415c..7d604d41 100644 --- a/.github/workflows/workflow-issue-status.yml +++ b/.github/workflows/workflow-issue-status.yml @@ -50,12 +50,15 @@ jobs: run: | ISSUE_NUMBER="" - if [ "$GITHUB_EVENT_NAME" == "issues" ] && [ "$GITHUB_EVENT_ACTION" == "opened" ]; then - ISSUE_NUMBER="$GITHUB_ISSUE_NUMBER" - elif [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then - ISSUE_NUMBER=$(echo "$GITHUB_HEAD_REF" | grep -oE '^[0-9]+') + if [ "${{ github.event_name }}" == "issues" ] && [ "${{ github.event.action }}" == "opened" ]; then + ISSUE_NUMBER="${{ github.event.issue.number }}" + elif [ "${{ github.event_name }}" == "pull_request" ]; then + echo "test" + ISSUE_NUMBER=$(echo "${{ github.event.pull_request.head.ref }}" | grep -oE '^[0-9]+') fi + echo "test 2" + if [ -n "$ISSUE_NUMBER" ]; then echo "Issue number '$ISSUE_NUMBER'" echo "ISSUE_NUMBER=$ISSUE_NUMBER" >> $GITHUB_ENV @@ -63,11 +66,6 @@ jobs: echo "1. No issue found. The branch must be created from the issue page so that its name is in the correct format (e.g., 123-my-new-feature)." echo "2. This pull request was generated by a bot (e.g., Renovate or Dependabot), so it is expected that there isn't an associated issue linked to the pull request branch." fi - env: - GITHUB_EVENT_NAME: ${{ github.event_name }} - GITHUB_EVENT_ACTION: ${{ github.event.action }} - GITHUB_ISSUE_NUMBER: ${{ github.event.issue.number }} - GITHUB_HEAD_REF: ${{ github.event.pull_request.head.ref }} - name: Fetch issue project(s) information(s) if: ${{ env.ISSUE_NUMBER != '' }}