Update testing and debugging documentation #18
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 runs when a ticket is created. It checks if the ticket either: | |
# - title starts with '[TX Request]' | |
# - label 'translations-request' is present | |
# and if so, adds the translations-request label, and notifies the #wg-translations | |
# slack channel | |
# Note: The "translations-request" label is NOT auto-applied to all tickets created | |
# using any `translations-request-*` template, because only those with write access | |
# can add the label. Instead the template inserts [TX Request] at the beginning. | |
# So, this automation is shakily governed by hoping users do not remove that phrase. | |
name: Notifies slack channel wg-translations about newly created Translation Request tickets | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
# First parse issue title and add label, if it doesn't have it already bc only | |
# repo members can add the label, even tho it's defined in the template >:( | |
add_label: | |
runs-on: ubuntu-latest | |
# This is defined on all 2 jobs - so need to change x2 if changing this. | |
if: ${{ contains(github.event.issue.title, '[TX Request]') && !contains(github.event.issue.labels.*.name, 'translations-request') }} | |
steps: | |
- name: apply translations-request label | |
uses: actions-ecosystem/action-add-labels@v1 | |
with: | |
labels: translations-request | |
notify: | |
runs-on: ubuntu-latest | |
if: ${{ contains(github.event.issue.title, '[TX Request]') || contains(github.event.issue.labels.*.name, 'translations-request') }} | |
steps: | |
- name: Generate token | |
id: generate_token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.GRAPHQL_AUTH_APP_ID }} | |
private_key: ${{ secrets.GRAPHQL_AUTH_APP_PEM }} | |
- name: Alert in Slack | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
channel-id: C037XDB9KN1 | |
slack-message: "Incoming Translations request: ${{ github.event.issue.title }}\nAuthor: ${{ github.event.issue.user.login }}\nURL: ${{ github.event.issue.html_url }}" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }} | |
- name: Auto-Reply to Translations Request | |
env: | |
URL: ${{ github.event.issue.comments_url }} | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
run: | | |
curl \ | |
-X POST \ | |
$URL \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: token $GITHUB_TOKEN" \ | |
--data '{ "body": "Thank you for your report! The Translations WG has been notified and will take a look as soon as they can." }' |