Skip to content

Commit e233cf7

Browse files
committedOct 30, 2023
[skip ci] Add "force" input to allow bypassing the "pre-committed Package.resolved" check.
1 parent 1d7cbd4 commit e233cf7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎action.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
metadata:
2626
required: false
2727
description: 'User provided map of max 8 key/value pairs of metadata to include with the snapshot e.g. {"lastModified": "12-31-2022"}'
28+
force:
29+
required: false
30+
default: false
31+
description: If true, dependencies are submitted even if the source repository contains a committed Package.resolved file.
2832

2933
runs:
3034
using: composite
@@ -38,13 +42,15 @@ runs:
3842
CORRELATOR: ${{ github.workflow_ref }}-${{ github.job }}-${{ github.action }}-${{ runner.os }}
3943
REPO_SPEC: ${{ inputs.repository || github.repository }}
4044
TOKEN: ${{ inputs.token || github.token }}
45+
FORCE: ${{ inputs.force }}
4146
shell: bash
4247
run: |
4348
# If there's a preexisting Package.resolved, Git knows about it, and it's unmodified,
4449
# this action has nothing to do; a correct Dependabot configuration will already
4550
# process that file.
4651
if [[ -f "${PROJ}/Package.resolved" && \
47-
-z "$(git -C "${PROJ}" status --porcelain -uall --ignored -- Package.resolved)" ]]; then
52+
-z "$(git -C "${PROJ}" status --porcelain -uall --ignored -- Package.resolved)" && \
53+
"${FORCE}" != 'true' ]]; then
4854
echo "Dependencies are autodetected when Package.resolved is committed, exiting."
4955
exit 0
5056
elif [[ -f "${PROJ}/Package.resolved" ]]; then

0 commit comments

Comments
 (0)