Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove leading slash from dependabot metadata dir #216

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ jobs:
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
if [[ "${{ steps.metadata.outputs.directory }}" == "/" ]]; then
dependabot_dir="${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" ]]; then
echo "::set-output name=workspace::-iwr"
else
echo "::set-output name=workspace::-w ${{ steps.metadata.outputs.directory }}"
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "::set-output name=workspace::-w ${dependabot_dir#/}"
fi

- name: Apply Changes
Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Commit and push all changes except workflows
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push-all.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 6 additions & 3 deletions lib/content/post-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ jobs:
if: contains(steps.metadata.outputs.dependency-names, '{{ __NAME__ }}')
id: flags
run: |
if [[ "$\{{ steps.metadata.outputs.directory }}" == "/" ]]; then
dependabot_dir="$\{{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" ]]; then
echo "::set-output name=workspace::-iwr"
else
echo "::set-output name=workspace::-w $\{{ steps.metadata.outputs.directory }}"
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "::set-output name=workspace::-w ${dependabot_dir#/}"
fi

- name: Apply Changes
Expand Down Expand Up @@ -65,7 +68,7 @@ jobs:
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Commit and push all changes except workflows
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push-all.outcome == 'failure'
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
Expand Down
27 changes: 18 additions & 9 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,13 @@ jobs:
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
if [[ "\${{ steps.metadata.outputs.directory }}" == "/" ]]; then
dependabot_dir="\${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" ]]; then
echo "::set-output name=workspace::-iwr"
else
echo "::set-output name=workspace::-w \${{ steps.metadata.outputs.directory }}"
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "::set-output name=workspace::-w \${dependabot_dir#/}"
fi

- name: Apply Changes
Expand Down Expand Up @@ -651,7 +654,7 @@ jobs:
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Commit and push all changes except workflows
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push-all.outcome == 'failure'
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -2089,10 +2092,13 @@ jobs:
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
if [[ "\${{ steps.metadata.outputs.directory }}" == "/" ]]; then
dependabot_dir="\${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" ]]; then
echo "::set-output name=workspace::-iwr"
else
echo "::set-output name=workspace::-w \${{ steps.metadata.outputs.directory }}"
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "::set-output name=workspace::-w \${dependabot_dir#/}"
fi

- name: Apply Changes
Expand Down Expand Up @@ -2129,7 +2135,7 @@ jobs:
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Commit and push all changes except workflows
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push-all.outcome == 'failure'
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -3362,10 +3368,13 @@ jobs:
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
if [[ "\${{ steps.metadata.outputs.directory }}" == "/" ]]; then
dependabot_dir="\${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" ]]; then
echo "::set-output name=workspace::-iwr"
else
echo "::set-output name=workspace::-w \${{ steps.metadata.outputs.directory }}"
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "::set-output name=workspace::-w \${dependabot_dir#/}"
fi

- name: Apply Changes
Expand Down Expand Up @@ -3402,7 +3411,7 @@ jobs:
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Commit and push all changes except workflows
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push-all.outcome == 'failure'
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
Expand Down