Skip to content

Commit

Permalink
chore: Updated versioned security agent workflow with simpler setup (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Jun 11, 2024
1 parent e2efc1f commit a886187
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/versioned-security-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,24 @@ jobs:
name: Should Run
runs-on: ubuntu-latest
outputs:
previous_version: ${{steps.versions.outputs.PREVIOUS_VAL}}
current_version: ${{steps.versions.outputs.CURRENT_VAL}}
sec_agent_did_change: ${{ steps.check_sec_agent.outputs.divergent }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: tj-actions/changed-files@v44
id: changed_files
- name: Check Security Agent Changed
id: check_sec_agent
uses: jsumners-nr/gha-node-deps-divergent@643628fe0da51ec025e984c4644f17fd9f9e93f6
with:
files: package.json
- name: Get dependency versions
id: versions
if: steps.changed_files.outputs.any_changed == 'true'
run: |
current_val=$(cat package.json | jq -r --arg pkg "@newrelic/security-agent" '.dependencies[$pkg]')
echo "current_val=${current_val}" >> $GITHUB_OUTPUT
git checkout origin/${{github.base_ref || 'main'}}
previous_val=$(cat package.json | jq -r --arg pkg "@newrelic/security-agent" '.dependencies[$pkg]')
echo "previous_val=${previous_val}" >> $GITHUB_OUTPUT
git checkout ${{github.sha}}
base-sha: ${{ github.base_ref || 'main' }}
current-sha: ${{ github.sha }}
package-name: '@newrelic/security-agent'

security-agent-tests:
needs: [should_run]
if: github.event_name == 'workflow_dispatch' ||
github.event_name == 'schedule' ||
needs.should_run.outputs.previous_version != needs.should_run.outputs.current_version
needs.should_run.outputs.sec_agent_did_change == 'true'

runs-on: ubuntu-latest

Expand Down

0 comments on commit a886187

Please sign in to comment.