Skip to content

Commit

Permalink
Test reusable workflow and detecting changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
another-rex committed Jul 4, 2023
1 parent 6eec552 commit a8e179a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/osv-scanner-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: OSV-Scanner PR scanning

permissions:
contents: read

# env:
# # Generator
# BUILDER_BINARY: slsa-generator-generic-linux-amd64 # Name of the binary in the release assets.
# BUILDER_DIR: internal/builders/generic # Source directory if we compile the builder.

# defaults:
# run:
# shell: bash

on:
workflow_call:
inputs:
outputs:

jobs:
scan-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37

# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with:
# since_last_remote_commit: true

- name: List all changed files
run: |
echo ${{ steps.changed-files.outputs.all_changed_files }}
echo ------------
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
2 changes: 2 additions & 0 deletions .github/workflows/osv-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
# actions: read

steps:
- name: "Run reusable workflow"
uses: .github/workflows/osv-scanner-pr.yml
- name: "Checkout code"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
Expand Down

0 comments on commit a8e179a

Please sign in to comment.