diff options
| author | seth <[email protected]> | 2023-01-16 19:23:34 +0000 |
|---|---|---|
| committer | seth <[email protected]> | 2023-01-19 21:34:03 -0500 |
| commit | ca137f6c94d42a4dd594bfd51d62307548ce1a8c (patch) | |
| tree | 52a4d390ea4fabb8d99f6141deb6e9c3da06660a /.github/workflows/check-commit.yml | |
| parent | 1cf59b4b31c805d1e13c48e4add91f57deaa3a5f (diff) | |
feat: automatically check for new packwiz commits
Diffstat (limited to '.github/workflows/check-commit.yml')
| -rw-r--r-- | .github/workflows/check-commit.yml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/.github/workflows/check-commit.yml b/.github/workflows/check-commit.yml new file mode 100644 index 0000000..dbb7f56 --- /dev/null +++ b/.github/workflows/check-commit.yml @@ -0,0 +1,31 @@ +name: Get latest commit +on: + schedule: + - cron: '0 0 * * *' + +jobs: + get-commit: + runs-on: ubuntu-latest + steps: + - uses: archtions/[email protected] + - name: Fetch packwiz commit + run: | + curl -sL https://api.github.com/repos/packwiz/packwiz/commits | jq .[0].sha > current_commit.txt + - name: Check for new commit + id: git-check + run: | + echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") + - name: Update cached commit + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'github-actions' + git config --global user.email '[email protected]' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + + git add current_commit.txt + + git commit -m "chore: update packwiz commit" + git tag "$(date '+%Y%m%d')" + + git push + git puh --tags |
