refactor: move scripts to scripts folder
This is a bit tidier.
This commit is contained in:
parent
838f205020
commit
0ba2ba478f
5 changed files with 13 additions and 13 deletions
12
action.yml
12
action.yml
|
@ -71,7 +71,7 @@ runs:
|
||||||
id: pr-number
|
id: pr-number
|
||||||
if: inputs.comment-on-pr == 'true'
|
if: inputs.comment-on-pr == 'true'
|
||||||
run: |
|
run: |
|
||||||
. "$GITHUB_ACTION_PATH/utils.sh"
|
. "$GITHUB_ACTION_PATH/scripts/utils.sh"
|
||||||
|
|
||||||
log 'Determine head_ref'
|
log 'Determine head_ref'
|
||||||
# For push & tag events it'll bet GITHUB_REF_NAME, for pull_request events it'll be GITHUB_HEAD_REF
|
# For push & tag events it'll bet GITHUB_REF_NAME, for pull_request events it'll be GITHUB_HEAD_REF
|
||||||
|
@ -121,7 +121,7 @@ runs:
|
||||||
BASE_BRANCH: ${{ inputs.base-branch }}
|
BASE_BRANCH: ${{ inputs.base-branch }}
|
||||||
JOB_NAME: ${{ inputs.job-name }}
|
JOB_NAME: ${{ inputs.job-name }}
|
||||||
run: |
|
run: |
|
||||||
. "$GITHUB_ACTION_PATH/utils.sh"
|
. "$GITHUB_ACTION_PATH/scripts/utils.sh"
|
||||||
|
|
||||||
# Input validation
|
# Input validation
|
||||||
if [ "$DO_COMPARISON" = 'true' ] && [ -z "$JOB_NAME" ]; then
|
if [ "$DO_COMPARISON" = 'true' ] && [ -z "$JOB_NAME" ]; then
|
||||||
|
@ -130,17 +130,17 @@ runs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create Size Report
|
# Create Size Report
|
||||||
"$GITHUB_ACTION_PATH/create-report.sh" > report.json
|
"$GITHUB_ACTION_PATH/scripts/create-report.sh" > report.json
|
||||||
|
|
||||||
# Nothing else to do
|
# Nothing else to do
|
||||||
if [ "$COMMENT" != 'true' ]; then exit 0; fi
|
if [ "$COMMENT" != 'true' ]; then exit 0; fi
|
||||||
|
|
||||||
# Try to do a comparison report
|
# Try to do a comparison report
|
||||||
if [ "$DO_COMPARISON" = 'true' ]; then
|
if [ "$DO_COMPARISON" = 'true' ]; then
|
||||||
if "$GITHUB_ACTION_PATH/retrieve-old-report.sh" && [ -f old-report.json ]; then
|
if "$GITHUB_ACTION_PATH/scripts/retrieve-old-report.sh" && [ -f old-report.json ]; then
|
||||||
log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH"
|
log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH"
|
||||||
|
|
||||||
"$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json
|
"$GITHUB_ACTION_PATH/scripts/comment_on_pr.sh" report.json old-report.json
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
error 'Failed to do comparison, fallback to posting the report without them'
|
error 'Failed to do comparison, fallback to posting the report without them'
|
||||||
|
@ -149,7 +149,7 @@ runs:
|
||||||
|
|
||||||
# Just report values
|
# Just report values
|
||||||
log 'Reporting on sizes'
|
log 'Reporting on sizes'
|
||||||
"$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json
|
"$GITHUB_ACTION_PATH/scripts/comment_on_pr.sh" report.json
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: https://git.salame.cl/actions/upload-artifact@v4
|
uses: https://git.salame.cl/actions/upload-artifact@v4
|
||||||
if: inputs.generate-artifact == 'true'
|
if: inputs.generate-artifact == 'true'
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
util_path="${GITHUB_ACTION_PATH:-.}/utils.sh"
|
util_path="${GITHUB_ACTION_PATH:-.}/scripts/utils.sh"
|
||||||
|
|
||||||
# shellcheck source=utils.sh
|
# shellcheck source=scripts/utils.sh
|
||||||
. "${util_path}"
|
. "${util_path}"
|
||||||
|
|
||||||
# USAGE: json_to_md_rows <FIELD> [JSON_FILE]
|
# USAGE: json_to_md_rows <FIELD> [JSON_FILE]
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
util_path="${GITHUB_ACTION_PATH:-.}/utils.sh"
|
util_path="${GITHUB_ACTION_PATH:-.}/scripts/utils.sh"
|
||||||
|
|
||||||
# shellcheck source=utils.sh
|
# shellcheck source=scripts/utils.sh
|
||||||
. "${util_path}"
|
. "${util_path}"
|
||||||
|
|
||||||
group 'Retrieving Flake information'
|
group 'Retrieving Flake information'
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
. "${GITHUB_ACTION_PATH}/utils.sh"
|
. "${GITHUB_ACTION_PATH}/scripts/utils.sh"
|
||||||
|
|
||||||
repo_info() {
|
repo_info() {
|
||||||
curl -X GET \
|
curl -X GET \
|
|
@ -13,9 +13,9 @@ error() {
|
||||||
}
|
}
|
||||||
|
|
||||||
group() {
|
group() {
|
||||||
log "::group::$1"
|
echo "::group::$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
endgroup() {
|
endgroup() {
|
||||||
log '::endgroup::'
|
echo '::endgroup::'
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue