-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (52 loc) · 2.11 KB
/
generate_sets.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
52
53
54
55
56
57
58
59
name: Generate Gentoo package sets
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
paths:
- scripts/generate_set_files.py
- scripts/eessi_sets.yml
pull_request:
branches: [ main ]
paths:
- scripts/generate_set_files.py
- scripts/eessi_sets.yml
# Declare default permissions as read only.
permissions: read-all
jobs:
generate_sets:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Set up Python
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.3.0
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Run script that generates the package set files
run: |
pip install PyYAML
python scripts/generate_set_files.py -y scripts/eessi_sets.yml -d etc/portage/sets
- name: Commit added/modified package set files
if: ${{ github.event_name != 'pull_request' }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add etc/portage/sets/*
git commit -m "Add generated set files" -a || echo "No changes to commit"
- name: Create Pull Request
if: ${{ github.event_name != 'pull_request' }}
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
branch: update_set_files
delete-branch: true
title: 'Update automatically generated set files'
labels: sets