Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: nyagami <[email protected]>
  • Loading branch information
error7404 and nyagami committed Jun 7, 2024
1 parent 105b5ca commit aa47f43
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/theme_auto_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,27 @@ on:

jobs:
auto-label:
if: contains(github.event.issue.labels.*.name, 'Source Request')
runs-on: ubuntu-latest
steps:
- name: Check if label is "Source Request"
id: label_check
run: |
LABEL_NAME=$(jq --raw-output .label.name "$GITHUB_EVENT_PATH")
if [[ "$LABEL_NAME" == "Source Request" ]]; then
echo "source_request=true" >> $GITHUB_OUTPUT
else
echo "source_request=false" >> $GITHUB_OUTPUT
echo "# ❌ Skipping: label is not Source request" >> $GITHUB_STEP_SUMMARY
fi

- name: Get Source Request URL
if: steps.label_check.outputs.source_request == 'true'
env:
ISSUE_BODY: ${{ github.event.issue.body }}
id: get_url
run: |
ISSUE_BODY=$(jq --raw-output .issue.body "$GITHUB_EVENT_PATH")
URL=$(echo "$ISSUE_BODY" | sed -n '/### Source link/,+2p' | sed '1,2d' | tr -d '[:space:]')
echo "URL=$URL" >> $GITHUB_OUTPUT
echo "Using URL: \`$URL\`" >> $GITHUB_STEP_SUMMARY
- name: Get issue number
if: steps.label_check.outputs.source_request == 'true'
env:
GITHUB_ISSUE_NUMBER: ${{ github.event.issue.number }}
id: get_issue_number
run: |
GITHUB_ISSUE_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH")
echo "GITHUB_ISSUE_NUMBER=$GITHUB_ISSUE_NUMBER" >> $GITHUB_OUTPUT
- name: Check if URL is valid
if: steps.label_check.outputs.source_request == 'true'
id: url_check
env:
URL: ${{ steps.get_url.outputs.URL }}
Expand Down

0 comments on commit aa47f43

Please sign in to comment.