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

chore: Updated versioned security agent workflow with simpler setup #2259

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
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
27 changes: 9 additions & 18 deletions .github/workflows/versioned-security-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,25 @@ 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
with:
files: package.json
- name: Get dependency versions
id: versions
- name: Check Security Agent Changed
id: check_sec_agent
if: steps.changed_files.outputs.any_changed == 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know this wasn't changed but where is this job?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it but forgot to remove this line. Good catch.

jsumners-nr marked this conversation as resolved.
Show resolved Hide resolved
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}}
uses: jsumners-nr/gha-node-deps-divergent@643628fe0da51ec025e984c4644f17fd9f9e93f6
with:
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