forked from galaxyproject/training-material
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.71 KB
/
shortlinks.yaml
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
52
53
54
55
56
57
name: "[Cron] Update Shortlinks"
on:
workflow_dispatch:
schedule:
- cron: '45 0 * * 1'
jobs:
runner-job:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
# Only run on main repo on and PRs that match the main repo.
if: |
github.repository == 'galaxyproject/training-material' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10
persist-credentials: false
# BEGIN Dependencies
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- uses: actions/cache@v4
with:
path: |
vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle pristine ffi
# END Dependencies
- name: Update Shortlinks
id: generate
run: |
echo "new_ids=$(ruby bin/update-shortlink.rb | wc -l)" >> $GITHUB_OUTPUT
- name: Create Pull Request
# If it's not a Pull Request then commit any changes as a new PR.
if: |
github.event_name != 'pull_request' &&
steps.generate.outputs.new_ids != '0'
uses: peter-evans/create-pull-request@v7
with:
title: Update Persistent uniform resource locators
branch-suffix: timestamp
commit-message: Update PURLs
add-paths: metadata/shortlinks.yaml