Skip to content

Commit a886187

Browse files
authoredJun 11, 2024··
chore: Updated versioned security agent workflow with simpler setup (#2259)
1 parent e2efc1f commit a886187

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed
 

‎.github/workflows/versioned-security-agent.yml

+8-18
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,24 @@ jobs:
3939
name: Should Run
4040
runs-on: ubuntu-latest
4141
outputs:
42-
previous_version: ${{steps.versions.outputs.PREVIOUS_VAL}}
43-
current_version: ${{steps.versions.outputs.CURRENT_VAL}}
42+
sec_agent_did_change: ${{ steps.check_sec_agent.outputs.divergent }}
4443
steps:
4544
- uses: actions/checkout@v4
4645
with:
4746
fetch-depth: 2
48-
- uses: tj-actions/changed-files@v44
49-
id: changed_files
47+
- name: Check Security Agent Changed
48+
id: check_sec_agent
49+
uses: jsumners-nr/gha-node-deps-divergent@643628fe0da51ec025e984c4644f17fd9f9e93f6
5050
with:
51-
files: package.json
52-
- name: Get dependency versions
53-
id: versions
54-
if: steps.changed_files.outputs.any_changed == 'true'
55-
run: |
56-
current_val=$(cat package.json | jq -r --arg pkg "@newrelic/security-agent" '.dependencies[$pkg]')
57-
echo "current_val=${current_val}" >> $GITHUB_OUTPUT
58-
59-
git checkout origin/${{github.base_ref || 'main'}}
60-
previous_val=$(cat package.json | jq -r --arg pkg "@newrelic/security-agent" '.dependencies[$pkg]')
61-
echo "previous_val=${previous_val}" >> $GITHUB_OUTPUT
62-
63-
git checkout ${{github.sha}}
51+
base-sha: ${{ github.base_ref || 'main' }}
52+
current-sha: ${{ github.sha }}
53+
package-name: '@newrelic/security-agent'
6454

6555
security-agent-tests:
6656
needs: [should_run]
6757
if: github.event_name == 'workflow_dispatch' ||
6858
github.event_name == 'schedule' ||
69-
needs.should_run.outputs.previous_version != needs.should_run.outputs.current_version
59+
needs.should_run.outputs.sec_agent_did_change == 'true'
7060

7161
runs-on: ubuntu-latest
7262

0 commit comments

Comments
 (0)
Please sign in to comment.