-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
52 lines (49 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
name: 'Loxcan'
author: 'Naoki Ikeguchi'
description: 'Universal Lock File Scanner for Git.'
branding:
icon: 'search'
color: 'yellow'
inputs:
report_enabled:
required: true
description: 'Reports to GitHub pull request only if this input is "true".'
default: '${{ github.event.repository.owner.id == github.event.pull_request.head.user.id }}'
owner:
required: true
description: 'The owner (organization) of the repository.'
default: ${{ github.event.repository.owner.login }}
repo:
required: true
description: 'The name of the repository.'
default: ${{ github.event.repository.name }}
base:
required: true
description: 'The base branch of the pull request.'
default: ${{ github.event.pull_request.base.ref }}
issue_number:
required: true
description: 'The number of a issue or pull request to add a comment.'
default: ${{ github.event.pull_request.number }}
token:
required: true
description: 'An OAuth token to access to the repository as a bot.'
default: ${{ github.token }}
runs:
using: 'composite'
steps:
- shell: bash
run: |
pushd '${{ github.action_path }}' && composer i -n && popd
if [ "${{ inputs.report_enabled }}" = "true" ]; then
export LOXCAN_ARGS="-r github"
export LOXCAN_REPORTER_GITHUB="1"
export LOXCAN_REPORTER_GITHUB_OWNER="${{ inputs.owner }}"
export LOXCAN_REPORTER_GITHUB_REPO="${{ inputs.repo }}"
export LOXCAN_REPORTER_GITHUB_ISSUE_NUMBER="${{ inputs.issue_number }}"
export LOXCAN_REPORTER_GITHUB_TOKEN="${{ inputs.token }}"
export LOXCAN_REPORTER_GITHUB_USERNAME="github-actions[bot]"
fi
BRANCH_BASE="origin/${{ inputs.base }}"
BRANCH_HEAD="${{ github.sha }}"
${{ github.action_path }}/bin/loxcan ${LOXCAN_ARGS} "${BRANCH_BASE}" "${BRANCH_HEAD}"