| 1 |
name: import upstream |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
- cron: "0 0 * * 0" |
| 6 |
workflow_dispatch: |
| 7 |
|
| 8 |
permissions: write-all |
| 9 |
|
| 10 |
jobs: |
| 11 |
import: |
| 12 |
runs-on: ubuntu-latest |
| 13 |
steps: |
| 14 |
- uses: actions/checkout@v6 |
| 15 |
- run: | |
| 16 |
git config --global user.name "github-actions[bot]" |
| 17 |
git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 18 |
- id: import |
| 19 |
run: | |
| 20 |
make import |
| 21 |
echo "commit=$(cat .github/UPSTREAM | head -n1)" >> $GITHUB_OUTPUT |
| 22 |
- name: Create Pull Request |
| 23 |
id: cpr |
| 24 |
uses: peter-evans/create-pull-request@v8 |
| 25 |
with: |
| 26 |
commit-message: "feat: import upstream package" |
| 27 |
title: "Import upstream package [create-pull-request]" |
| 28 |
body: | |
| 29 |
Import upstream changes from [tree](https://github.com/golang/tools/tree/${{ steps.import.outputs.commit }}/internal/diff). |
| 30 |
|
| 31 |
Take a look at the [diff](https://github.com/golang/tools/commits/master/internal/diff) to see what changed. |
| 32 |
branch: "import-upstream" |
| 33 |
delete-branch: true |
| 34 |
- name: Check outputs |
| 35 |
if: ${{ steps.cpr.outputs.pull-request-number }} |
| 36 |
run: | |
| 37 |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" |
| 38 |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
| 39 |
|
| 40 |
|