-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
90 lines (84 loc) · 2.91 KB
/
action.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "spack updater action"
description: "Given a local spack repository, compare a package to upstream spack and pull request appropriately."
inputs:
package:
description: package in local repo to check
required: true
upstream:
description: upstream to open issue to request update (should be repository here)
required: true
user:
default: user for to GitHub to PR
required: true
token:
default: token authenticate to GitHub to PR
required: true
local_branch:
description: branch here to open pull request against (defaults to main)
default: "main"
repo:
description: local repository with recipes (defaults to PWD)
default: "."
runs:
using: "composite"
steps:
- name: Install Dependencies
env:
action_path: ${{ github.action_path }}
shell: bash
run: |
cd ${action_path}
pip install -r requirements.txt
cd -
- name: Build Package
env:
GITHUB_TOKEN: ${{ inputs.token }}
user: ${{ inputs.user }}
repo: ${{ inputs.repo }}
upstream: ${{ inputs.upstream }}
package: ${{ inputs.package }}
action_path: ${{ github.action_path }}
run: |
cmd="python ${action_path}/scripts/update_package.py --repo ${repo} ${package} --upstream ${upstream}"
echo ${cmd}
$cmd
shell: bash
# Case 1: changes from local TO spack pushes to a branch -> issue -> open PR
- name: Create Update Branch
if: ${{ env.spack_updater_to_spack == 'true' }}
shell: bash
env:
GITHUB_ACTOR: ${{ inputs.user }}
GITHUB_TOKEN: ${{ inputs.token }}
BRANCH_AGAINST: ${{ inputs.local_branch }}
package: ${{ inputs.package }}
repo: ${{ inputs.repo }}
action_path: ${{ github.action_path }}
run: /bin/bash ${action_path}/scripts/branch_pull_request_to_spack.sh
- name: Pull Request Issue
if: ${{ env.open_pr_to_spack != '' }}
shell: bash
env:
GITHUB_ACTOR: ${{ inputs.user }}
GITHUB_TOKEN: ${{ inputs.token }}
package: ${{ inputs.package }}
action_path: ${{ github.action_path }}
run: python ${action_path}/scripts/open_issue.py
# Case 2: changes from spack TO here stages for
- name: Pull request changes
if: ${{ env.spack_updater_from_spack == 'true' }}
shell: bash
env:
GITHUB_ACTOR: ${{ inputs.user }}
GITHUB_TOKEN: ${{ inputs.token }}
BRANCH_AGAINST: ${{ inputs.local_branch }}
package: ${{ inputs.package }}
repo: ${{ inputs.repo }}
action_path: ${{ github.action_path }}
run: /bin/bash ${action_path}/scripts/branch_pull_request_to_local.sh
- name: Open Pull Request
if: ${{ env.open_pr_to_here != '' }}
uses: vsoch/pull-request-action@master
env:
GITHUB_TOKEN: ${{ inputs.token }}
PULL_REQUEST_BRANCH: ${{ inputs.local_branch }}