Skip to content

Commit

Permalink
Create PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Aug 15, 2023
1 parent 7bd4a9a commit f79eb3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/update-ghc.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def main():
with open('haskell/private/ghc_bindist_generated.bzl', 'r+') as generated:
run(['buildifier'], check=True, input=bzl, stdout=generated)
generated.truncate()

if 'GITHUB_OUTPUT' in os.environ:
with open(os.environ["GITHUB_OUTPUT"], 'a') as output:
print(f"latest={ latest_release }", file=output)
else:
print("no tags found for prefix", prefix, file=sys.stderr)

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/update-ghc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ jobs:
with:
nix_path: nixpkgs=nixpkgs/default.nix
- name: Fetch updates
id: ghc_update
run: nix shell 'nixpkgs#bazel-buildtools' 'nixpkgs#python3' --command python .github/update-ghc.py ${{ matrix.ghc }}
- run: git diff
- name: Create Pull Request
if: steps.ghc_update.outputs.latest != ''
uses: peter-evans/create-pull-request@v5
with:
commit-message: "[automation] Add GHC version "
title: "[update] GHC ${{ steps.ghc_update.latest }}"
branch: "automation/update-ghc-${{ matrix.ghc }}"
base: master
# TODO: needs a token so that workflows for the PR get triggered
#token: "${{ secrets.PR_TOKEN }}"

0 comments on commit f79eb3c

Please sign in to comment.