| 1 |
name: Update Repository |
| 2 |
|
| 3 |
on: |
| 4 |
# every Sunday at 00:36 UTC |
| 5 |
# https://crontab.guru/#36_2_*_*_0 |
| 6 |
schedule: |
| 7 |
- cron: 36 2 * * 0 |
| 8 |
|
| 9 |
workflow_dispatch: |
| 10 |
|
| 11 |
concurrency: |
| 12 |
group: ${{ github.workflow }}-${{ github.repository }} |
| 13 |
cancel-in-progress: true |
| 14 |
|
| 15 |
permissions: |
| 16 |
contents: read |
| 17 |
|
| 18 |
jobs: |
| 19 |
update: |
| 20 |
name: Update repository files |
| 21 |
runs-on: ubuntu-slim |
| 22 |
permissions: |
| 23 |
contents: write # Required to commit synced template and workflow updates. |
| 24 |
pull-requests: write # Required to open the generated update pull request. |
| 25 |
issues: write # Required for generated update pull request metadata. |
| 26 |
steps: |
| 27 |
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 28 |
with: |
| 29 |
persist-credentials: false |
| 30 |
|
| 31 |
- name: Configure git user |
| 32 |
run: | |
| 33 |
git config --global user.name 'Conda Bot' |
| 34 |
git config --global user.email '[email protected]' |
| 35 |
|
| 36 |
- uses: conda/actions/combine-durations@d88418cd4e36358ba51e7c88f2d2d5edb9ac49e7 # v26.8.1 |
| 37 |
id: durations |
| 38 |
continue-on-error: true |
| 39 |
|
| 40 |
- uses: conda/actions/template-files@d88418cd4e36358ba51e7c88f2d2d5edb9ac49e7 # v26.8.1 |
| 41 |
id: templates |
| 42 |
continue-on-error: true |
| 43 |
|
| 44 |
- name: Commit changes |
| 45 |
# no-op if there are no updates |
| 46 |
continue-on-error: true |
| 47 |
run: | |
| 48 |
git add . |
| 49 |
git commit --message "🤖 updated file(s)" |
| 50 |
|
| 51 |
- name: Create fork |
| 52 |
# no-op if the repository is already forked |
| 53 |
run: | |
| 54 |
FORK="$(gh repo fork --clone=false --default-branch-only 2>&1 | awk '{print $1}' | sed 's|^https://github.com/||')" |
| 55 |
echo "FORK=${FORK}" >> "$GITHUB_ENV" |
| 56 |
env: |
| 57 |
GH_TOKEN: ${{ secrets.SYNC_TOKEN }} |
| 58 |
|
| 59 |
- uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 |
| 60 |
with: |
| 61 |
push-to-fork: ${{ env.FORK }} |
| 62 |
token: ${{ secrets.SYNC_TOKEN }} |
| 63 |
branch: update |
| 64 |
delete-branch: true |
| 65 |
title: 🤖 Update infrastructure file(s) |
| 66 |
body: | |
| 67 |
[update.yml]: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/update.yml |
| 68 |
|
| 69 |
Your friendly repository updater. |
| 70 |
|
| 71 |
${{ steps.durations.outputs.summary }} |
| 72 |
|
| 73 |
${{ steps.templates.outputs.summary }} |
| 74 |
|
| 75 |
This PR was triggered by @${{ github.triggering_actor }} via ${{ github.event_name }}. |
| 76 |
|
| 77 |
###### Auto-generated by the [`update.yml`][update.yml] workflow, see ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. |