This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.64 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# worflow to call the update.sh script and create a PR based on the changes
name: update
on:
schedule:
- cron: '*/10 * * * *'
workflow_dispatch:
jobs:
pre_job:
name: Check for New Releases
outputs:
exists: ${{ steps.check-age.outputs.exists }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: "actions/checkout@v3"
- name: Check For Release Age
id: check-age
run: |
echo ""exists=$((curl -s https://api.github.com/repos/ow-mods/ow-mod-man/releases) | jq -r '(((now - (.[0].published_at | fromdateiso8601)) / (60*60) | trunc) == 0)')"" >> $GITHUB_OUTPUT
- name: Result
id: result
#run: |
# echo "${{ steps.check-age.outputs.exists }}"
if: ${{ steps.check-age.outputs.exists == 'true' }}
run: echo "new version of the manager! 🥳"
update:
runs-on: ubuntu-latest
if: ${{ needs.pre_job.outputs.exists == 'true' || github.event_name != 'schedule' }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Packages
run: ./update.sh
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Package Version Update
title: 'Package Version Update'
body: >
This PR is auto-generated by
[create-pull-request](https://github.com/peter-evans/create-pull-request).
labels: package update, automated pr