Skip to content

Commit

Permalink
docs: add example for 'pull_request_url' (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar authored Nov 17, 2023
1 parent 195e70c commit 33264f6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- [Custom `crowdin.yml` file location](#custom-crowdinyml-file-location)
- [Separate PRs for each target language](#separate-prs-for-each-target-language)
- [Checking out multiple branches in a single workflow](#checking-out-multiple-branches-in-a-single-workflow)
- [Outputs](#outputs)
- [`pull_request_url`](#pull_request_url)
- [Triggers](#triggers)
- [Cron schedule](#cron-schedule)
- [Manually](#manually)
Expand Down Expand Up @@ -408,6 +410,37 @@ strategy:

[Read more](https://github.com/crowdin/github-action/wiki/Handling-parallel-runs)

## Outputs

### `pull_request_url`

There is a possibility to get the URL of the created Pull Request. You can use it in the next steps of your workflow.

```yaml
# ...
- name: Crowdin
uses: crowdin/github-action@v1
id: crowdin-download
with:
download_translations: true
create_pull_request: true
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- name: Enable auto-merge for the PR
if: steps.crowdin-download.outputs.pull_request_url
run: gh pr --repo $GITHUB_REPOSITORY merge ${{ steps.crowdin-download.outputs.pull_request_url }} --auto --merge
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Approve the PR
if: steps.crowdin-download.outputs.pull_request_url
run: gh pr --repo $GITHUB_REPOSITORY review ${{ steps.crowdin-download.outputs.pull_request_url }} --approve
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```

## Tips and Tricks

### Checking the translation progress
Expand Down

0 comments on commit 33264f6

Please sign in to comment.