-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (39 loc) · 1.47 KB
/
post-pr.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
name: Move Files from Under Consideration to Published
on:
pull_request:
types:
- closed
branches:
- main
jobs:
move:
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'conformance-file')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.COMMIT_KEY }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: Move files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ $file == *"data/file_features/under_consideration/"* ]]; then
relative_path="${file#*data/file_features/under_consideration/}"
mkdir -p "data/file_features/published/$(dirname "$relative_path")"
mv "$file" "data/file_features/published/$relative_path"
fi
done
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: Publish Conformance Files of ${{ github.event.pull_request.head.ref }}
commit-message: Move files from under consideration to published
body: |
This PR moves the conformance files submitted in #${{ github.event.number }} from under consideration to published.
branch: move-files-${{ github.event.pull_request.head.ref }}
delete-branch: true