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

Reusable nancy workflow #14

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
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
62 changes: 62 additions & 0 deletions .github/workflows/reusable-nancy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2020 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.

name: Nancy

on:
workflow_call:

permissions:
contents: read

jobs:
nancy:
name: Sonatype Nancy
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34 # v1.5.0
with:
egress-policy: block
disable-telemetry: true
allowed-endpoints: >
github.com:443
api.github.com:443
objects.githubusercontent.com:443
dl-cdn.alpinelinux.org:443
ossindex.sonatype.org:443
proxy.golang.org:443
sum.golang.org:443

- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
persist-credentials: false

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go 1.x
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1
with:
go-version: ^1.18

- name: Write Go module list
run: |
go list -json -m all > go.list
cat go.list

- name: Perform Nancy
uses: sonatype-nexus-community/nancy-github-action@aae196481b961d446f4bff9012e4e3b63d7921a4 # v1.0.2
with:
nancyVersion: "v1.0.41"
continue-on-error: true