newrelic_security 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90213be8f4f16d3ac2402f570f734466927d341581a73e3382f8d843d0a4486e
4
- data.tar.gz: a329513f2be86620ecccd38f2811b842b897028c06027e47930b3dea4e8b7b4c
3
+ metadata.gz: cb2b9eb9b3fa826a6ce2a115d67ee4eaa157e8afe902aecce040dace93d7ac51
4
+ data.tar.gz: 9cc4b2468a6d84423efd65909731357c1a9f34e628475c8fece4562460499ba3
5
5
  SHA512:
6
- metadata.gz: 565fbe75ccb52096f5e1e1549f5dfdea51f96435a2ee0a8819723e1c996c731f6090a6edb3bb1673318a9273288b031a3645e7d64f81a56cd0212181d64647e4
7
- data.tar.gz: d176f0228f7f448e2fd08abd28906f59c4e0cac88abcd41bd7a2c02b30c427a78c990cc08a41d3626d5e4ec1cb62809cc2d029bcce7b8f88aa20736c883373c6
6
+ metadata.gz: e63de0976aa1266d76a67d7b47bd6d5199ec6984704676c1120d5353c379be0cef61dc2f606a26656950d7c9ce39385371281221feec3a065aeb73b5eb2f90a1
7
+ data.tar.gz: 24a02159c93530d038a81d4072e0aa33ab4dc68299f1e729599aeb69cf2c5096e23b439913127cd5c15aa38804fcfdf3a9b0139168198d0edb2c6ffdf202a39e
@@ -72,6 +72,6 @@ jobs:
72
72
  with:
73
73
  token: ${{ secrets.GITHUB_TOKEN }}
74
74
  resultPath: lib/coverage_results/.last_run.json
75
- failedThreshold: 67
76
- failedThresholdBranch: 25
75
+ failedThreshold: 65
76
+ failedThresholdBranch: 20
77
77
 
@@ -5,47 +5,64 @@ on:
5
5
  branches:
6
6
  - main
7
7
 
8
+ permissions:
9
+ contents: read
10
+
8
11
  jobs:
9
- release:
10
- runs-on: ubuntu-latest
12
+ publish:
13
+ runs-on: ubuntu-24.04 # pinned: setup-ruby v1.195.0 predates ubuntu-26.04
14
+ environment: release
11
15
  permissions:
12
- contents: write
13
- repository-projects: write
16
+ contents: read
17
+ id-token: write # RubyGems trusted publishing (OIDC)
18
+ outputs:
19
+ version: ${{ steps.version.outputs.VERSION }}
14
20
  steps:
15
21
  - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2
16
22
  with:
17
- fetch-depth: 0
23
+ persist-credentials: false
18
24
 
19
25
  - uses: ruby/setup-ruby@086ffb1a2090c870a3f881cc91ea83aa4243d408 # v1.195.0
20
26
  with:
21
27
  ruby-version: 3.2
22
28
 
23
- - name: Install onetimepass
24
- run: pip install onetimepass==1.0.1
25
-
26
- - name: Configure gem credentials
27
- run: |
28
- echo "GEM_HOST_API_KEY=${{ secrets.RUBYGEMS_API_KEY }}" >> $GITHUB_ENV
29
- echo "RUBYGEMS_MFA_KEY=${{ secrets.RUBYGEMS_MFA_KEY }}" >> $GITHUB_ENV
29
+ - name: Determine version
30
+ id: version
31
+ run: echo "VERSION=$(ruby -r ./lib/newrelic_security/version -e 'puts NewRelic::Security::VERSION')" >> "$GITHUB_OUTPUT"
30
32
 
31
33
  - name: Build newrelic_security gem
32
34
  run: gem build newrelic_security.gemspec
33
35
 
34
- - name: Determine version
35
- run: |
36
- echo "VERSION=$(ls newrelic_security-*.gem | ruby -pe 'sub(/newrelic_security\-(.*).gem/, "\\1")')" >> $GITHUB_ENV
37
-
38
- - name: Create github release
39
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # tag v0.1.15
40
- if: $(git tag -l ${{ env.VERSION }}) == false
41
- with:
42
- tag_name: ${{ env.VERSION }}
43
- env:
44
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
-
46
- - name: Obtain OTP to publish newrelic_security to rubygems.org
47
- run: echo "RUBYGEMS_OTP=$(python ./.github/workflows/scripts/rubygems-authenticate.py RUBYGEMS_MFA_KEY)" >> $GITHUB_ENV
36
+ - name: Configure RubyGems trusted publishing credentials
37
+ uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # tag v2.1.0
48
38
 
49
39
  - name: Publish newrelic_security to rubygems.org
50
- run: ruby ./.github/workflows/scripts/rubygems-publish.rb newrelic_security
40
+ run: |
41
+ if ! output=$(gem push newrelic_security-*.gem 2>&1); then
42
+ echo "$output"
43
+ echo "$output" | grep -q 'Repushing of gem versions is not allowed' || exit 1
44
+ echo "Version already published, skipping"
45
+ else
46
+ echo "$output"
47
+ fi
51
48
 
49
+ github-release:
50
+ needs: [publish]
51
+ runs-on: ubuntu-latest
52
+ permissions:
53
+ contents: write
54
+ env:
55
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56
+ VERSION: ${{ needs.publish.outputs.version }}
57
+ steps:
58
+ - name: Create github release
59
+ run: |
60
+ if gh release view "$VERSION" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
61
+ echo "Release $VERSION already exists, skipping"
62
+ else
63
+ gh release create "$VERSION" \
64
+ --repo "$GITHUB_REPOSITORY" \
65
+ --target "$GITHUB_SHA" \
66
+ --title "$VERSION" \
67
+ --notes ''
68
+ fi