Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
(cherry picked from commit 953702a)
  • Loading branch information
hugoalh committed Sep 10, 2024
1 parent 5e7a691 commit c298032
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 25 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/invoke-codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,19 @@ jobs:
actions: "read"
contents: "read"
security-events: "write"
uses: "hugoalh/hugoalh/.github/workflows/call-invoke-codeql-analysis-0.yml@main"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
with:
fetch-depth: "0"
- name: "Initialize CodeQL"
uses: "github/codeql-action/[email protected]"
with:
queries: "+security-and-quality"
# Automatically build attempts to build any compiled languages.
- name: "Build Repository"
uses: "github/codeql-action/[email protected]"
continue-on-error: true
- name: "Analyze Repository"
uses: "github/codeql-action/[email protected]"
13 changes: 12 additions & 1 deletion .github/workflows/invoke-devskim-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@ jobs:
actions: "read"
contents: "read"
security-events: "write"
uses: "hugoalh/hugoalh/.github/workflows/call-invoke-devskim-analysis-0.yml@main"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
with:
fetch-depth: "0"
- name: "Analyze Repository"
uses: "microsoft/[email protected]"
- name: "Upload Analysis Result"
uses: "github/codeql-action/[email protected]"
with:
sarif_file: "devskim-results.sarif"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Publish Docker Container - GitHub Packages"
name: "Publish Docker Image"
on:
push:
tags:
Expand All @@ -22,23 +22,29 @@ env:
REGISTRY: "ghcr.io"
IMAGE_NAME: "${{github.event.repository.full_name}}"
jobs:
main:
name: "Main"
ghp:
name: "GitHub Packages"
permissions:
contents: "read"
packages: "write"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
- name: "Sign In To Registry ${{env.REGISTRY}}"
- name: "Setup Docker Buildx"
uses: "docker/[email protected]"
- name: "Sign In To GitHub Packages"
uses: "docker/[email protected]"
with:
registry: "${{env.REGISTRY}}"
registry: "ghcr.io"
username: "${{github.actor}}"
password: "${{github.token}}"
- name: "Generate Docker Metadata"
id: "docker-meta"
- name: "Resolve Metadata"
id: "metadata"
uses: "docker/[email protected]"
with:
images: "${{env.REGISTRY}}/${{env.IMAGE_NAME}}"
images: |-
name=ghcr.io/${{github.repository}}
tags: |-
type=raw,enable=${{inputs.tag != ''}},value=${{inputs.tag}}
type=raw,enable=${{inputs.latest == 'true'}},value=latest
Expand All @@ -47,21 +53,25 @@ jobs:
type=semver,enable=${{inputs.tag == ''}},pattern={{major}}.{{minor}}
type=semver,enable=${{inputs.tag == ''}},pattern={{major}}
labels: |-
org.opencontainers.image.authors=${{github.event.repository.owner.login}}
org.opencontainers.image.authors=${{github.repository_owner}}
org.opencontainers.image.licenses=MIT
org.opencontainers.image.title=Send Discord Webhook (GitHub Action) Image
org.opencontainers.image.description=A Docker image for Send Discord Webhook (GitHub Action) to send Discord webhook.
- name: "Build & Push Docker Image"
- name: "Build & Publish Docker Image"
uses: "docker/[email protected]"
with:
context: "./"
file: "Dockerfile"
labels: "${{steps.docker-meta.outputs.labels}}"
labels: "${{steps.metadata.outputs.labels}}"
platforms: |-
linux/amd64
pull: "true"
push: "true"
tags: "${{steps.docker-meta.outputs.tags}}"
tags: "${{steps.metadata.outputs.tags}}"
cache-from: |-
type=gha
cache-to: |-
type=gha,mode=max
- name: "List Docker Image"
run: |-
docker image ls --all --digests --no-trunc
27 changes: 17 additions & 10 deletions .github/workflows/scan-virus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@ jobs:
name: "Main"
permissions:
contents: "read"
uses: "hugoalh/hugoalh/.github/workflows/call-scan-virus-0.yml@main"
with:
git_integrate: "${{github.event.inputs.git_integrate || 'False'}}"
git_limit: "${{github.event.inputs.git_limit || '0'}}"
git_reverse: "${{github.event.inputs.git_reverse || 'False'}}"
ignores_post: |-
Param($ElementPostMeta)
Return (
$ElementPostMeta.Path -imatch '^node_modules[\\/]'
)
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
with:
fetch-depth: "0"
- name: "Scan Repository"
uses: "hugoalh/scan-virus-ghaction/[email protected]"
with:
git_integrate: "${{github.event.inputs.git_integrate || 'False'}}"
git_limit: "${{github.event.inputs.git_limit || '0'}}"
git_reverse: "${{github.event.inputs.git_reverse || 'False'}}"
ignores_post: |-
Param($ElementPostMeta)
Return (
$ElementPostMeta.Path -imatch '^node_modules[\\/]'
)
10 changes: 9 additions & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ jobs:
contents: "read"
issues: "write"
pull-requests: "write"
uses: "hugoalh/hugoalh/.github/workflows/call-sync-labels-0.yml@main"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
- name: "Sync Labels"
uses: "EndBug/[email protected]"
with:
config-file: ".github/labels.yml"
delete-other-labels: "true"

0 comments on commit c298032

Please sign in to comment.