From: Viktor Szakats Date: Fri, 6 Jun 2025 20:30:12 +0000 (+0200) Subject: GHA/hacktoberfest-accepted: tidy up item order X-Git-Tag: curl-8_15_0~321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d16a020a870a7b4ba64842eaff25d9033034af7b;p=thirdparty%2Fcurl.git GHA/hacktoberfest-accepted: tidy up item order `if`, then `env`, then `run`. Also tidy up quotes in env entries. Closes #17551 --- diff --git a/.github/workflows/hacktoberfest-accepted.yml b/.github/workflows/hacktoberfest-accepted.yml index e01338b222..e40da119eb 100644 --- a/.github/workflows/hacktoberfest-accepted.yml +++ b/.github/workflows/hacktoberfest-accepted.yml @@ -32,40 +32,40 @@ jobs: fetch-depth: 100 - name: Check whether repo participates in Hacktoberfest + id: check + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | gh config set prompt disabled && echo "label=$( gh repo view --json repositoryTopics --jq '.repositoryTopics[].name' | grep '^hacktoberfest$')" >> $GITHUB_OUTPUT - id: check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Search relevant commit message lines starting with Closes/Merges + if: steps.check.outputs.label == 'hacktoberfest' env: GITHUB_EVENT_BEFORE: '${{ github.event.before }}' GITHUB_EVENT_AFTER: '${{ github.event.after }}' run: | git log --format=email "${GITHUB_EVENT_BEFORE}..${GITHUB_EVENT_AFTER}" | \ grep -Ei '^Close[sd]? ' | sort | uniq | tee log - if: steps.check.outputs.label == 'hacktoberfest' - name: Search for Number-based PR references + if: steps.check.outputs.label == 'hacktoberfest' + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | grep -Eo '#([0-9]+)' log | cut -d# -f2 | sort | uniq | xargs -t -n1 -I{} \ gh pr view {} --json number,createdAt \ --jq '{number, opened: .createdAt} | [.number, .opened] | join(":")' | tee /dev/stderr | \ grep -Eo '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \ gh pr edit {} --add-label 'hacktoberfest-accepted' - if: steps.check.outputs.label == 'hacktoberfest' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Search for URL-based PR references + if: steps.check.outputs.label == 'hacktoberfest' + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | grep -Eo 'github.com/(.+)/(.+)/pull/([0-9]+)' log | sort | uniq | xargs -t -n1 -I{} \ gh pr view 'https://{}' --json number,createdAt \ --jq '{number, opened: .createdAt} | [.number, .opened] | join(":")' | tee /dev/stderr | \ grep -Eo '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \ gh pr edit {} --add-label 'hacktoberfest-accepted' - if: steps.check.outputs.label == 'hacktoberfest' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}