Skip to content

Commit

Permalink
Harmonize with the current newrelic org
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgonze committed Oct 23, 2024
1 parent d468fed commit d56c821
Show file tree
Hide file tree
Showing 17 changed files with 330 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/fossa-caos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
uses: newrelic-csec/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

Expand All @@ -28,4 +28,4 @@ jobs:
with:
ssh-private-key: ${{ secrets.CAOS_RUST_CRATE_FOSSA }}
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
uses: newrelic-csec/.github/.github/composite/fossa-composite@main
31 changes: 31 additions & 0 deletions .github/workflows/fossa-caos.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FOSSA CLI Analysis - CAOS
on:
pull_request:
branches: [ $default-branch ]

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

fossa:
needs: check_env
if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }}
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
CUSTOM_PROPS_PAT: ${{ secrets.FOSSA_PAT }}
HAS_FOSSA_TARGETS: ""
FOSSA_ANALYZE_RESULT: ""

steps:
- uses: actions/checkout@v3
- name: Give GitHub Actions access to private crates
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.CAOS_RUST_CRATE_FOSSA }}
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
21 changes: 21 additions & 0 deletions .github/workflows/fossa-check-env.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: FOSSA Check Env
on:
workflow_call:
secrets:
FOSSA_API_KEY:
required: false
outputs:
HAS_FOSSA_API_KEY:
description: "True if FOSSA API key is available."
value: ${{ jobs.check_env.outputs.check }}

jobs:
check_env:
runs-on: ubuntu-latest
env:
HAS_FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY != '' }}
steps:
- id: check-fossa-api-key
run: echo "check=$HAS_FOSSA_API_KEY" >> "$GITHUB_OUTPUT"
outputs:
check: ${{ steps.check-fossa-api-key.outputs.check }}
4 changes: 2 additions & 2 deletions .github/workflows/fossa-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
uses: newrelic-csec/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

Expand All @@ -24,4 +24,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
uses: newrelic-csec/.github/.github/composite/fossa-composite@main
27 changes: 27 additions & 0 deletions .github/workflows/fossa-default.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: FOSSA CLI Analysis - Default
on:
pull_request:
branches: [ $default-branch ]

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

fossa:
needs: check_env
if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }}
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
CUSTOM_PROPS_PAT: ${{ secrets.FOSSA_PAT }}
HAS_FOSSA_TARGETS: ""
FOSSA_ANALYZE_RESULT: ""

steps:
- uses: actions/checkout@v3
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
4 changes: 2 additions & 2 deletions .github/workflows/fossa-elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
uses: newrelic-csec/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

Expand All @@ -28,4 +28,4 @@ jobs:
otp-version: '26'
elixir-version: '1.15'
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
uses: newrelic-csec/.github/.github/composite/fossa-composite@main
31 changes: 31 additions & 0 deletions .github/workflows/fossa-elixir.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FOSSA CLI Analysis - Elixir
on:
pull_request:
branches: [ $default-branch ]

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

fossa:
needs: check_env
if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }}
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
CUSTOM_PROPS_PAT: ${{ secrets.FOSSA_PAT }}
HAS_FOSSA_TARGETS: ""
FOSSA_ANALYZE_RESULT: ""

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: '26'
elixir-version: '1.15'
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
4 changes: 2 additions & 2 deletions .github/workflows/fossa-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
uses: newrelic-csec/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

Expand Down Expand Up @@ -47,4 +47,4 @@ jobs:
- name: Setup Gradle options
run: echo "GRADLE_OPTIONS=--console=plain --parallel -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64,JAVA_HOME_21_X64" >> $GITHUB_ENV
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
uses: newrelic-csec/.github/.github/composite/fossa-composite@main
50 changes: 50 additions & 0 deletions .github/workflows/fossa-gradle.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: FOSSA CLI Analysis - Gradle
on:
pull_request:
branches: [ $default-branch ]

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

fossa:
needs: check_env
if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }}
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
CUSTOM_PROPS_PAT: ${{ secrets.FOSSA_PAT }}
HAS_FOSSA_TARGETS: ""
FOSSA_ANALYZE_RESULT: ""

steps:
- name: Checkout this repo
uses: actions/checkout@v4
- name: Setup javas
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
21
17
11
8
- name: Set gradle.properties
run: |
export GRADLE_PROPERTIES_PATH="./gradle.properties"
echo "jdk8=${JAVA_HOME_8_X64}" >> $GRADLE_PROPERTIES_PATH
echo "jdk11=${JAVA_HOME_11_X64}" >> $GRADLE_PROPERTIES_PATH
echo "jdk17=${JAVA_HOME_17_X64}" >> $GRADLE_PROPERTIES_PATH
echo "jdk21=${JAVA_HOME_21_X64}" >> $GRADLE_PROPERTIES_PATH
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true
- name: Setup Gradle options
run: echo "GRADLE_OPTIONS=--console=plain --parallel -Porg.gradle.java.installations.auto-detect=false -Porg.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64,JAVA_HOME_21_X64" >> $GITHUB_ENV
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
4 changes: 2 additions & 2 deletions .github/workflows/fossa-ruby-bundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
uses: newrelic-csec/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

Expand Down Expand Up @@ -40,4 +40,4 @@ jobs:
fi
done
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
uses: newrelic-csec/.github/.github/composite/fossa-composite@main
43 changes: 43 additions & 0 deletions .github/workflows/fossa-ruby-bundler.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: FOSSA CLI Analysis - Ruby
on:
pull_request:
branches: [ $default-branch ]

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

fossa_ruby:
needs: check_env
if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }}
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
CUSTOM_PROPS_PAT: ${{ secrets.FOSSA_PAT }}
HAS_FOSSA_TARGETS: ""
FOSSA_ANALYZE_RESULT: ""

steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Ensure that a Gemfile.lock file exists for each Gemfile file
run: |
echo "Ensuring that Gemfile.lock files exist..."
for gemfile in $(find . -name Gemfile -not -path './test/**' -not -path './spec/**'); do
dir=${gemfile%/*}
echo "Found Gemfile at $dir"
if [[ -e "$dir/Gemfile.lock" ]]; then
echo "Found Gemfile.lock at $dir"
else
echo "No Gemfile.lock found at $dir - generating one..."
bundle lock --gemfile "$dir/Gemfile"
fi
done
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
6 changes: 3 additions & 3 deletions .github/workflows/fossa-scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
uses: newrelic-csec/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

Expand All @@ -24,9 +24,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Download newrelic.jar
if: ${{ github.repository == 'newrelic/newrelic-java-examples' }}
if: ${{ github.repository == 'newrelic-csec/newrelic-java-examples' }}
run: |
mkdir newrelic-java-agent/scala/segment-api-synchronous/libs
curl https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic.jar --output newrelic-java-agent/scala/segment-api-synchronous/libs/newrelic.jar
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
uses: newrelic-csec/.github/.github/composite/fossa-composite@main
32 changes: 32 additions & 0 deletions .github/workflows/fossa-scala.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: FOSSA CLI Analysis - Scala
on:
pull_request:
branches: [ $default-branch ]

jobs:
check_env:
uses: newrelic/.github/.github/workflows/fossa-check-env.yml@main
secrets:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

fossa:
needs: check_env
if: ${{ needs.check_env.outputs.HAS_FOSSA_API_KEY == 'true' }}
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
CUSTOM_PROPS_PAT: ${{ secrets.FOSSA_PAT }}
HAS_FOSSA_TARGETS: ""
FOSSA_ANALYZE_RESULT: ""

steps:
- uses: actions/checkout@v3
- name: Download newrelic.jar
if: ${{ github.repository == 'newrelic/newrelic-java-examples' }}
run: |
mkdir newrelic-java-agent/scala/segment-api-synchronous/libs
curl https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic.jar --output newrelic-java-agent/scala/segment-api-synchronous/libs/newrelic.jar
- id: fossa-cli
uses: newrelic/.github/.github/composite/fossa-composite@main
2 changes: 1 addition & 1 deletion .github/workflows/repolinter-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
token: ${{ secrets.REPOLINTER_TOKEN }}

- name: Run Repolinter
uses: newrelic/repolinter-action@v1
uses: newrelic-csec/repolinter-action@v1
with:
directory: ${{ github.workspace }}/apply
config_file: ${{ github.workspace }}/repo/${{ matrix.config }}
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/repolinter-apply.ymlbup
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Apply Repolinter
on:
push:
branches:
- main
schedule:
- cron: '24 21 * * *'
workflow_dispatch:

jobs:
apply-repolinter:
name: Apply Repolinter (${{ matrix.repo }})
strategy:
fail-fast: false
matrix:
include:
# Edit here to add other repositories
- repo: newrelic/newrelic-python-agent
config: repolinter-rulesets/community-plus.yml
- repo: newrelic/opentelemetry-exporter-python
config: repolinter-rulesets/community-plus.yml
runs-on: ubuntu-latest
steps:
- name: Checkout Self
uses: actions/checkout@v2
with:
path: ./repo

- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v2
with:
path: ./apply
repository: ${{ matrix.repo }}
token: ${{ secrets.REPOLINTER_TOKEN }}

- name: Run Repolinter
uses: newrelic/repolinter-action@v1
with:
directory: ${{ github.workspace }}/apply
config_file: ${{ github.workspace }}/repo/${{ matrix.config }}
config_url: ${{ matrix.config }}
output_type: issue
username: nr-opensource-bot
repository: ${{ matrix.repo }}
token: ${{ secrets.REPOLINTER_TOKEN }}


Loading

0 comments on commit d56c821

Please sign in to comment.