Skip to content

Translations

Translations #101

Workflow file for this run

name: Translations
# **What it does**:
# **Why we have it**:
# **Who does it impact**: Docs localization
on:
schedule:
- cron: '20 19 * * *' # once a day at 19:20 UTC / 11:20 PST
permissions:
pull-requests: write
env:
FREEZE: ${{ secrets.FREEZE }}
jobs:
prepare:
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
- if: ${{ env.FREEZE == 'true' }}
run: |
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
- name: Find original Pull Request
uses: juliangruber/find-pull-request-action@db875662766249c049b2dcd85293892d61cb0b51
id: pr
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: translations
base: main
author: octoglot
state: open
- if: ${{ steps.pr.outputs.number }}
name: Check if already labeled
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
id: has-label
with:
script: |
const { data: labels } = await github.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ steps.pr.outputs.number }}
})
if (labels.find(label => label.name === 'automerge')) {
return 'ok'
}
- if: ${{ !steps.has-label.outputs.result }}
name: Approve Pull Request
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.pr.outputs.number }}
- if: ${{ !steps.has-label.outputs.result }}
name: Add automerge label
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with:
issue-number: ${{ steps.pr.outputs.number }}
add-labels: 'automerge'