-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from DeterminateSystems/auto-update-downstream…
…-repos Auto-submit pull requests to downstream repos
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Update downstream | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
update-downstream-repos: | ||
name: Pull request detsys-ts update to ${{ github.repository_owner }}/${{ matrix.repo }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
repo: | ||
- flake-checker-action | ||
- flakehub-push | ||
- flakehub-mirror | ||
- magic-nix-cache-action | ||
- nix-installer-action | ||
- update-flake-lock | ||
env: | ||
REF: ${{ github.sha }} | ||
REF_URL: https://github.com/${{ github.repository }}/tree/${{ github.sha }} | ||
GIT_USER: ${{ github.actor }} | ||
GIT_EMAIL: ${{ github.actor }}@users.noreply.github.com | ||
TARGET_REPO: ${{ github.repository_owner }}/${{ matrix.repo }} | ||
SOURCE_REPO: ${{ github.repository }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
steps: | ||
- name: Check out ${{ env.TARGET_REPO }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.TARGET_REPO }} | ||
token: ${{ env.GITHUB_TOKEN }} | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@main | ||
|
||
- name: Set up Magic Nix Cache | ||
uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: Configure Git for ${{ env.GIT_USER }} | ||
run: | | ||
git config user.name "${{ env.GIT_USER }}" | ||
git config user.email "${{ env.GIT_EMAIL }}" | ||
- name: Update detsys-ts dependency for ${{ env.TARGET_REPO }} to ref ${{ env.REF }} | ||
run: | | ||
nix develop --command pnpm update detsys-ts | ||
nix develop --command pnpm all | ||
- name: Commit changes to package.json, pnpm-lock.yaml, and dist/ | ||
run: | | ||
git add . | ||
if [[ $(git status -s) ]]; then | ||
git commit \ | ||
--message "update(deps): update detsys-ts dependency to ${{ env.REF }} and rebuild dist directory" \ | ||
--no-verify | ||
echo "updated detsys-ts dependency to ${{ env.REF }} and rebuilt dist directory" | ||
else | ||
echo "error: pnpm dependencies do not seem to have changed" | ||
exit 1 | ||
fi | ||
- name: Create pull request against ${{ env.TARGET_REPO }} | ||
run: | | ||
gh pr create \ | ||
--repo ${{ env.TARGET_REPO }} \ | ||
--title "Update detsys-ts dependency and dist directory (trigged by ${{ env.SOURCE_REPO }})" \ | ||
--body "Bump detsys-ts to [${{ env.REF }}](${{ env.REF_URL }}) and regenerate application bundle." |