i18n: Raidboss general output&4.x content CN output overhaul #1914
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow auto-labels PRs based on various criteria: | |
# - If a PR is opened or a new commit is pushed: | |
# - The workflow runs auto-label.cjs to add scope-related labels and to add 'needs-review' | |
# (unless the PR already has an approving review from a maintainer). | |
# - The workflow will check for linked issues and add the 'fix-me' label to them. | |
# - If a review (approving or otherwise) is added to the PR by a maintainer, the workflow | |
# removes the 'needs-review' label. | |
# - If 'auto merge' is enabled or disabled on the PR, the workflow adds/removes the | |
# 'auto-merge' label. | |
name: PR Auto Label | |
on: | |
pull_request_target: | |
types: | |
- edited | |
- synchronize | |
- opened | |
- reopened | |
- auto_merge_enabled | |
- auto_merge_disabled | |
- ready_for_review | |
# Use the 'workflow_run' event as a workaround/hook to catch runs of the 'PR Review' workflow. | |
# See `label-pr-review.yml` comments for more info about why these gymnastics are necessary. | |
workflow_run: | |
workflows: | |
- PR Review | |
types: | |
- completed | |
jobs: | |
job_picker: | |
runs-on: ubuntu-latest | |
outputs: | |
run: ${{ steps.label_job.outputs.run }} | |
steps: | |
- name: Determine label job | |
id: label_job | |
shell: bash | |
run: | | |
if [ "${{ contains(github.event.action,'auto_merge_') }}" == "true" ]; then | |
echo "run=auto_merge" >> $GITHUB_OUTPUT | |
elif [ "${{ github.event.action }}" == "completed" ]; then | |
echo "run=pr_review" >> $GITHUB_OUTPUT | |
elif [ "${{ github.event.action }}" == "ready_for_review" ]; then | |
echo "run=pr_ready" >> $GITHUB_OUTPUT | |
else | |
echo "run=push_commit" >> $GITHUB_OUTPUT | |
fi | |
auto_merge: | |
runs-on: ubuntu-latest | |
needs: job_picker | |
if: needs.job_picker.outputs.run == 'auto_merge' | |
steps: | |
- name: Add auto-merge label | |
uses: buildsville/[email protected] | |
if: github.event.action == 'auto_merge_enabled' | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
labels: auto-merge | |
type: add | |
- name: Remove auto-merge label | |
uses: buildsville/[email protected] | |
if: github.event.action == 'auto_merge_disabled' | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
labels: auto-merge | |
type: remove | |
pr_review: | |
runs-on: ubuntu-latest | |
needs: job_picker | |
if: needs.job_picker.outputs.run == 'pr_review' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Force checkout the main repo (base branch) so that repo secrets | |
# are not available to unexpected/malicious PR code. | |
ref: main | |
- uses: ./.github/actions/setup-js-env | |
- name: Update PR Review Labels | |
run: | | |
node .github/scripts/pr-review.cjs | |
env: | |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
pr_ready: | |
runs-on: ubuntu-latest | |
needs: job_picker | |
if: needs.job_picker.outputs.run == 'pr_ready' | |
steps: | |
- name: Add needs-review label | |
uses: buildsville/[email protected] | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
labels: needs-review | |
type: add | |
push_commit: | |
runs-on: ubuntu-latest | |
needs: job_picker | |
if: needs.job_picker.outputs.run == 'push_commit' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Force checkout the main repo (base branch) so that repo secrets | |
# are not available to unexpected/malicious PR code. | |
ref: main | |
- name: Check for linked issues | |
id: find-linked-issues | |
uses: mondeja/pr-linked-issues-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Label linked issues | |
if: join(steps.find-linked-issues.outputs.issues) != '' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Found linked issues: ${{ steps.find-linked-issues.outputs.issues }}" | |
issues=${{ steps.find-linked-issues.outputs.issues }} | |
for issue in ${issues//,/ }; do | |
echo "Adding 'fix-me' label to issue $issue" | |
gh issue edit $issue --add-label "fix-me" | |
done | |
- uses: ./.github/actions/setup-js-env | |
- name: Run Label Script | |
run: | | |
node .github/scripts/auto-label.cjs | |
env: | |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
PR_NUMBER: ${{ github.event.number }} |