forked from NMRLipids/BilayerData
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.64 KB
/
Copy pathUpdateIDs.yml
File metadata and controls
76 lines (66 loc) · 2.64 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Generate an unique ID for each simulation in the NMRlipids databank
#
# This workflow generates a pull request with the modification of the
# README files of conflictive systems.
#
# Contact:
# Fabián Suárez-Lestón
# fabian.suarez.leston@usc.es
name: UpdateIDs
# Controls when the workflow will run
on:
# Triggers the workflow on closed pull request events, but only for the "main" branch
pull_request_target:
types:
- closed
branches: [ "main" ]
paths: ['Simulations/**']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "UpdateIDs"
UpdateIDs:
# This job will run if either: workflow_dispatch OR:
# Pull request is merged AND
# The repository is NMRLipids/BilayerData AND
# The pull request is not labeled with "UpdateID"
if: ${{
(github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
github.repository == 'NMRLipids/BilayerData' &&
! contains(github.event.pull_request.labels.*.name, 'UpdateID')
))
}}
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v6
- name: Assign new IDs
id: newids
run: |
. .github/workflows/CheckIDs.sh generate
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v8
# Trigger the step only if there have been changes made to the IDs
if: steps.newids.outputs.newids == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update simulation IDs
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: workflow_addID_PR${{github.event.number}}
branch-suffix: short-commit-hash
title: Update IDs after pull request ${{github.event.number}}
body: |
Generated new IDs for duplicates or new systems in #${{ github.event.number}}.
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
UpdateID
AutoPR
draft: false