Skip to content

Commit

Permalink
Added workflow step to run if PR is a dependency type, and re-create …
Browse files Browse the repository at this point in the history
…lockfile using pnpm
  • Loading branch information
devpalabhishek committed Sep 1, 2023
1 parent 8abf477 commit 19f3193
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,36 @@ env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
OZONE_WITH_COVERAGE: ${{ github.repository == 'apache/ozone' && github.event_name != 'pull_request' }}
jobs:
dependabot-check:
if: contains(github.event.pull_request.labels.*.name, 'dependencies')
runs-on: ubuntu-20.04
env:
CI_COMMIT_MESSAGE: Re-created lockfile using pnpm
CI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: get_branch_name
- name: Delete the lockfile
run: |
#Delete the lockfile created by dependabot
rm -rf ./hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/pnpm-lock.yaml
- name: Install pnpm and update lockfile
uses: pnpm/action-setup@v2
with:
run_install: |
args: [--lockfile-only]
- name: Commit generated lockfile to PR
run: |
git add ./hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/pnpm-lock.yaml
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
- name: Push Changes to current branch
uses: ad-m/github-push-action@master
with:
branch: ${{ steps.get_branch_name.outputs.branch }}
github_token: ${{ env.CI_GITHUB_TOKEN }}
build-info:
runs-on: ubuntu-20.04
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"packageManager": "[email protected]",
"name": "ozone-recon",
"version": "0.1.0",
"private": true,
Expand Down

0 comments on commit 19f3193

Please sign in to comment.