-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add update.yaml workflow * Migrate conda/conda to update.yml * Migrate conda/conda-build to update.yml * Move release files into new templates directory * Add template-files/config.yml * Pre-commit edits * Add comment about where to edit * Minor edits * Add placeholder for RELEASE.md * Add initialization workflow to kickstart migration * conda/governance as SSOT * Always overwrite update.yml but don't overwrite config.yml * Include recent HWUG.md improvements * Restore conda & conda-build to old workflow * Remove template-files/config.yml from infrastructure repo * Create upstream PR to remove repo from sync.yml * Update naming * Use full length CoC.md Co-authored-by: Jannis Leidel <[email protected]>
- Loading branch information
1 parent
d818da4
commit 7ecd6e0
Showing
16 changed files
with
840 additions
and
44 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Initiate Repository | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
org: | ||
description: The GitHub organization within which the repository is located. | ||
required: true | ||
type: choice | ||
options: | ||
- conda | ||
- conda-incubator | ||
default: conda | ||
repo: | ||
description: The repository to push the update workflow to. | ||
required: true | ||
|
||
jobs: | ||
push: | ||
if: >- | ||
!github.event.repository.fork | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | ||
with: | ||
# repository: ${{ github.repository }} | ||
path: upstream | ||
|
||
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | ||
with: | ||
repository: ${{ github.event.inputs.org }}/${{ github.event.inputs.repo }} | ||
path: downstream | ||
|
||
- name: Configure git user | ||
run: | | ||
git config user.name 'Conda Bot' | ||
git config user.email '[email protected]' | ||
- name: (upstream) Remove repository from sync.yml | ||
run: sed -i '\%${{ github.event.inputs.org }}/${{ github.event.inputs.repo }}$%d' upstream/.github/sync/config.yml | ||
|
||
- name: (upstream) Commit changes | ||
run: cd upstream && git add . && git commit --message "🤖 updated file(s)" || true | ||
|
||
- name: (upstream) Create fork | ||
run: cd upstream && echo UPSTREAM=$(gh repo fork --clone=false --default-branch-only | awk '{print $1}') >> $GITHUB_ENV | ||
env: | ||
GH_TOKEN: ${{ secrets.SYNC_TOKEN }} | ||
|
||
- name: (upstream) Create PR | ||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 | ||
with: | ||
push-to-fork: ${{ env.UPSTREAM }} | ||
token: ${{ secrets.SYNC_TOKEN }} | ||
branch: init-${{ github.event.inputs.org }}-${{ github.event.inputs.repo }} | ||
delete-branch: true | ||
title: 🤖 Init ${{ github.event.inputs.org }}/${{ github.event.inputs.repo }} | ||
body: | | ||
[init.yml]: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/init.yml | ||
Removes ${{ github.event.inputs.org }}/${{ github.event.inputs.repo }} from the `sync.yml` workflow. | ||
This PR was triggered by @${{ github.triggering_actor }} via ${{ github.event_name }}. | ||
###### Auto-generated by the [`init.yml`][init.yml] workflow, see ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. | ||
- name: (downstream) Copy (overwrite) update.yml | ||
run: cp -f upstream/.github/workflows/update.yml downstream/.github/workflows/update.yml || true | ||
|
||
- name: (downstream) Copy (do not overwrite) config.yml | ||
run: cp -n upstream/templates/config.yml downstream/.github/template-files/config.yml || true | ||
|
||
- name: (downstream) Commit changes | ||
run: cd downstream && git add . && git commit --message "🤖 updated file(s)" || true | ||
|
||
- name: (downstream) Create fork | ||
run: cd downstream && echo DOWNSTREAM=$(gh repo fork --clone=false --default-branch-only | awk '{print $1}') >> $GITHUB_ENV | ||
env: | ||
GH_TOKEN: ${{ secrets.SYNC_TOKEN }} | ||
|
||
- name: (downstream) Create PR | ||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 | ||
with: | ||
push-to-fork: ${{ env.DOWNSTREAM }} | ||
token: ${{ secrets.SYNC_TOKEN }} | ||
branch: init | ||
delete-branch: true | ||
title: 🤖 Init | ||
body: | | ||
[init.yml]: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/init.yml | ||
This adds the `update.yml` workflow (and the accompanying `config.yml`) to this repository to enable regular syncing and templating of standard files (e.g., Code of Conduct file, CLA bot workflow, stale bot workflow, etc.). | ||
This PR was triggered by @${{ github.triggering_actor }} via ${{ github.event_name }}. | ||
###### Auto-generated by the [`update.yml`][update.yml] workflow, see ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Update Repository | ||
|
||
on: | ||
# every Sunday at 00:36 UTC | ||
# https://crontab.guru/#36_2_*_*_0 | ||
schedule: | ||
- cron: 36 2 * * 0 | ||
|
||
workflow_dispatch: | ||
|
||
issue_comment: | ||
types: | ||
- created | ||
|
||
jobs: | ||
update: | ||
if: >- | ||
!github.event.repository.fork | ||
&& ( | ||
github.event_name == 'schedule' | ||
|| github.event_name == 'workflow_dispatch' | ||
|| ( | ||
github.event_name == 'issue_comment' | ||
&& github.event.issue.pull_request | ||
&& ( | ||
github.event.comment.body == '@conda-bot render' | ||
|| github.event.comment.body == '@conda-bot recreate' | ||
) | ||
) | ||
) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: github.event_name == 'issue_comment' | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: eyes | ||
reactions-edit-mode: replace | ||
token: ${{ secrets.SYNC_TOKEN }} | ||
|
||
- if: github.event.comment.body == '@conda-bot render' | ||
name: Configure git origin | ||
run: | | ||
echo REPOSITORY=$(curl --silent ${{ github.event.issue.pull_request.url }} | jq --raw-output '.head.repo.full_name') >> $GITHUB_ENV | ||
echo REF=$(curl --silent ${{ github.event.issue.pull_request.url }} | jq --raw-output '.head.ref') >> $GITHUB_ENV | ||
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | ||
with: | ||
repository: ${{ env.REPOSITORY || github.repository }} | ||
ref: ${{ env.REF || '' }} | ||
|
||
- name: Configure git user | ||
run: | | ||
git config user.name 'Conda Bot' | ||
git config user.email '[email protected]' | ||
- uses: conda/actions/combine-durations@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0 | ||
|
||
- uses: conda/actions/template-files@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0 | ||
|
||
- name: Commit changes | ||
run: git add . && git commit --message "🤖 updated file(s)" || true | ||
|
||
- if: github.event.comment.body != '@conda-bot render' | ||
name: Create fork | ||
run: echo FORK=$(gh repo fork --clone=false --default-branch-only | awk '{print $1}') >> $GITHUB_ENV | ||
env: | ||
GH_TOKEN: ${{ secrets.SYNC_TOKEN }} | ||
|
||
- if: github.event.comment.body != '@conda-bot render' | ||
id: create | ||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 | ||
with: | ||
push-to-fork: ${{ env.FORK }} | ||
token: ${{ secrets.SYNC_TOKEN }} | ||
branch: update | ||
delete-branch: true | ||
title: 🤖 Update | ||
body: | | ||
[update.yml]: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/update.yml | ||
Your friendly repository updater. | ||
This PR was triggered by @${{ github.triggering_actor }} via ${{ github.event_name }}. | ||
<details> | ||
<summary>Commands</summary> | ||
Trigger actions by commenting on this PR: | ||
- `@conda-bot render` will run rendering workflows and commit and push any changes to this PR | ||
- `@conda-bot recreate` will recreate this PR, overwriting any edits that have been made to it | ||
</details> | ||
###### Auto-generated by the [`update.yml`][update.yml] workflow, see ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. | ||
- if: github.event.comment.body == '@conda-bot render' | ||
id: update | ||
name: Push changes | ||
run: git push --force-with-lease | ||
|
||
- if: always() && github.event_name == 'issue_comment' | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: ${{ (steps.create.conclusion == 'success' || steps.update.conclusion == 'success') && 'hooray' || 'confused' }} | ||
reactions-edit-mode: replace | ||
token: ${{ secrets.SYNC_TOKEN }} |
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 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
Oops, something went wrong.