Skip to content

Commit

Permalink
feat: tweak the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tsyirvo committed Apr 17, 2024
1 parent 555270e commit 8d8e807
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ jobs:
set-pr-data:
name: Check the PR state then set required outputs
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
outputs:
base_ref: ${{ steps.setting.outputs.base_ref }}
head_ref: ${{ steps.setting.outputs.head_ref }}
pr_number: ${{ steps.setting.outputs.pr_number }}
is_draft: ${{ steps.setting.outputs.is_draft }}
# env:
# GH_TOKEN: ${{ github.token }}
# outputs:
# base_ref: ${{ steps.setting.outputs.base_ref }}
# head_ref: ${{ steps.setting.outputs.head_ref }}
# pr_number: ${{ steps.setting.outputs.pr_number }}
# is_draft: ${{ steps.setting.outputs.is_draft }}

steps:
- uses: actions/checkout@v3
# steps:
# - uses: actions/checkout@v3

- name: Checking the PR state
id: pr
run: |
echo "state=$(gh pr view --json state | jq -r '.state')" >> $GITHUB_OUTPUT
# - name: Checking the PR state
# id: pr
# run: |
# echo "state=$(gh pr view --json state | jq -r '.state')" >> $GITHUB_OUTPUT

- name: Setting outputs
if: steps.pr.outputs.state == 'OPEN'
id: setting
run: |
echo "base_ref=$(gh pr view --json baseRefName | jq -r '.baseRefName')" >> $GITHUB_OUTPUT
echo "head_ref=$(gh pr view --json headRefName | jq -r '.headRefName')" >> $GITHUB_OUTPUT
echo "pr_number=$(gh pr view --json number | jq -r '.number')" >> $GITHUB_OUTPUT
echo "is_draft=$(gh pr view --json isDraft | jq -r '.isDraft')" >> $GITHUB_OUTPUT
# - name: Setting outputs
# if: steps.pr.outputs.state == 'OPEN'
# id: setting
# run: |
# echo "base_ref=$(gh pr view --json baseRefName | jq -r '.baseRefName')" >> $GITHUB_OUTPUT
# echo "head_ref=$(gh pr view --json headRefName | jq -r '.headRefName')" >> $GITHUB_OUTPUT
# echo "pr_number=$(gh pr view --json number | jq -r '.number')" >> $GITHUB_OUTPUT
# echo "is_draft=$(gh pr view --json isDraft | jq -r '.isDraft')" >> $GITHUB_OUTPUT

quality:
needs: set-pr-data
# needs: set-pr-data
runs-on: ubuntu-latest
if: |
needs.set-pr-data.outputs.is_draft == 'false'
# if: |
# needs.set-pr-data.outputs.is_draft == 'false'

steps:
- name: Checkout repo
Expand Down

0 comments on commit 8d8e807

Please sign in to comment.