Skip to content

Commit

Permalink
Updates pipeline to only run SF scanner for dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamessimone committed Aug 6, 2024
1 parent 018a9ec commit bbefea3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
**/__tests__
**/__mockData__
**/README.md
**/main
**/main
**/tsconfig.json

**/*.ts
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: 'Upload code coverage for LWC to Codecov.io'
uses: codecov/codecov-action@v3
if: ${{ !github.event.act }}
if: ${{ !github.event.act && !github.actor == 'dependabot[bot]' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: LWC
Expand All @@ -77,6 +77,7 @@ jobs:
# Authenticate using JWT flow
- name: 'Auth to dev hub'
shell: bash
if: ${{ !github.actor == 'dependabot[bot]' }}
run: |
echo "${{ env.DEVHUB_SERVER_KEY }}" > ./jwt-server.key
npx sf org login jwt --client-id ${{ env.DEVHUB_CONSUMER_KEY }} --username ${{ env.DEVHUB_USERNAME }} --jwt-key-file ./jwt-server.key --set-default-dev-hub
Expand All @@ -87,24 +88,26 @@ jobs:
DEVHUB_SERVER_KEY: ${{ secrets.DEVHUB_SERVER_KEY }}

- name: 'Deploy & Test'
if: ${{ !github.actor == 'dependabot[bot]' }}
id: 'deploy'
shell: pwsh
run: '. ./scripts/test.ps1'

- name: 'Possible Scratch Org Cleanup'
if: ${{ failure() && steps.deploy.conclusion == 'failure' }}
if: ${{ failure() && steps.deploy.conclusion == 'failure' && !github.actor == 'dependabot[bot]' }}
run: |
npm run delete:org
exit 1
# Delete temporary test files that Codecov is unable to parse
- name: 'Delete unparseable test coverage'
run: rm ./tests/apex/test-result-707*-codecoverage.json -f
if: ${{ !github.actor == 'dependabot[bot]' }}

# Upload Apex code coverage data
- name: 'Upload Apex code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v3
if: ${{ !github.event.act }}
if: ${{ !github.event.act && !github.actor == 'dependabot[bot]' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: Apex
Expand All @@ -121,7 +124,7 @@ jobs:
# Package versions are only created automatically within PRs that are pointed to main
# so those are the only times we need to update the README /sfdx-project.json and package.json
- name: 'Re-commit updated package version (if necessary)'
if: ${{ github.ref != 'refs/heads/main' && env.SHOULD_CREATE_AND_PROMOTE == '1' && github.actor == github.event.repository.owner.login && github.base_ref == 'main' }}
if: ${{ github.ref != 'refs/heads/main' && env.SHOULD_CREATE_AND_PROMOTE == '1' && github.actor == github.event.repository.owner.login && github.base_ref == 'main' && !github.actor == 'dependabot[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHOULD_CREATE_AND_PROMOTE: ${{ secrets.SHOULD_CREATE_AND_PROMOTE }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apex-rollup",
"version": "1.6.30",
"version": "1.6.31",
"description": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"package": "apex-rollup",
"path": "rollup",
"scopeProfiles": true,
"versionName": "Regenerates Extra Code Coverage plugin and updates RollupFlowTests.shouldReportErrorWhenConcatDelimiterSetAndNotConcat to comprehensively test all outcomes",
"versionNumber": "1.6.30.0",
"versionName": "Update pipeline so that dependabot only runs SF scanner",
"versionNumber": "1.6.31.0",
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
"unpackagedMetadata": {
Expand Down

0 comments on commit bbefea3

Please sign in to comment.