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 +4 -4
- data/.github/workflows/pr_ci.yml +2 -2
- data/.github/workflows/release.yml +44 -27
- data/.rubocop_todo.yml +165 -199
- data/CHANGELOG.md +8 -0
- data/Gemfile_test +2 -0
- data/lib/newrelic_security/instrumentation-security/pg/instrumentation.rb +1 -1
- data/lib/newrelic_security/version.rb +1 -1
- metadata +2 -4
- data/.github/workflows/scripts/rubygems-authenticate.py +0 -13
- data/.github/workflows/scripts/rubygems-publish.rb +0 -33
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb2b9eb9b3fa826a6ce2a115d67ee4eaa157e8afe902aecce040dace93d7ac51
|
|
4
|
+
data.tar.gz: 9cc4b2468a6d84423efd65909731357c1a9f34e628475c8fece4562460499ba3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e63de0976aa1266d76a67d7b47bd6d5199ec6984704676c1120d5353c379be0cef61dc2f606a26656950d7c9ce39385371281221feec3a065aeb73b5eb2f90a1
|
|
7
|
+
data.tar.gz: 24a02159c93530d038a81d4072e0aa33ab4dc68299f1e729599aeb69cf2c5096e23b439913127cd5c15aa38804fcfdf3a9b0139168198d0edb2c6ffdf202a39e
|
data/.github/workflows/pr_ci.yml
CHANGED
|
@@ -5,47 +5,64 @@ on:
|
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
7
|
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
8
11
|
jobs:
|
|
9
|
-
|
|
10
|
-
runs-on: ubuntu-
|
|
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:
|
|
13
|
-
|
|
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
|
-
|
|
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:
|
|
24
|
-
|
|
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:
|
|
35
|
-
|
|
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:
|
|
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
|