forked from xuanxu/deposit-pull-request-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
60 lines (59 loc) · 1.87 KB
/
action.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
60
name: Deposit Pull Request
description: Creates the accepted paper pull request
inputs:
papers_repo:
description: The repository containing the published and submitted papers
required: true
issue_id:
description: The issue number of the submission
required: true
bot_token:
description: The access token to be used to upload files
required: false
papers_repo_main_branch:
description: The name of the repo's main branch to issue the pull request against
required: false
default: "main"
branch_prefix:
description: The prefix to add to the name of all branches
required: false
default: ""
mode:
description: "'dry-run' or 'deposit' (deposit mode will merge the PR and delete the paper's branch)"
required: false
default: "dry-run"
outputs:
pr_url:
description: "URL of the pull request"
value: ${{ steps.deposit_pr_creator.outputs.pr_url }}
runs:
using: "composite"
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1
bundler-cache: true
cache-version: deposit-pull-request
bundler: Gemfile.lock
working-directory: ${{ github.action_path }}
- name: Create pull request
id: deposit_pr_creator
shell: bash
env:
PAPERS_REPO: ${{ inputs.papers_repo }}
PAPERS_REPO_MAIN_BRANCH: ${{ inputs.papers_repo_main_branch }}
BRANCH_PREFIX: ${{ inputs.branch_prefix }}
ISSUE_ID: ${{ inputs.issue_id }}
BOT_TOKEN: ${{ inputs.bot_token }}
MODE: ${{ inputs.mode }}
BUNDLE_GEMFILE: ${{ github.action_path }}/Gemfile
run: |
bundle exec ruby ${{ github.action_path }}/deposit_pr.rb
- name: Print results
shell: bash
run: |
echo "Pull request for the paper: ${{ steps.deposit_pr_creator.outputs.pr_url }}"
branding:
icon: git-merge
color: green