Skip to content

Commit

Permalink
Update fossa-scan.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-oloumi committed Nov 20, 2024
1 parent 61f7a2c commit 0cb078f
Show file tree
Hide file tree
Showing 44 changed files with 7,296 additions and 7,296 deletions.
114 changes: 57 additions & 57 deletions .github/workflows/backport-assistant.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This action creates downstream PRs for PRs with backport labels defined.
# See docs here: https://github.com/hashicorp/backport-assistant

name: Backport Assistant Runner

on:
pull_request_target:
types:
- closed
- labeled
branches:
- main
- 'release/*.*.x'

jobs:
backport:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
container: hashicorpdev/backport-assistant:0.4.4
steps:
- name: Run Backport Assistant for release branches
run: |
backport-assistant backport -merge-method=squash
env:
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+)"
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}.x"
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN_WORKFLOW }}
ENABLE_VERSION_MANIFESTS: true
backport-ent:
if: github.event.pull_request.merged && contains(join(github.event.pull_request.labels.*.name), 'backport/ent')
runs-on: ubuntu-latest
steps:
- name: Trigger backport for Enterprise
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
repository: hashicorp/consul-enterprise
event-type: ent-backport
client-payload: ${{ toJson(github.event) }}
handle-failure:
needs:
- backport
- backport-ent
if: always() && (needs.backport.result == 'failure' || needs.backport-ent.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Comment on PR
run: |
github_message="Backport failed @${{ github.event.sender.login }}. Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -s -H "Authorization: token ${{ secrets.PR_COMMENT_TOKEN }}" \
-X POST \
-d "{ \"body\": \"${github_message}\"}" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${{ github.event.pull_request.number }}/comments"
## Copyright (c) HashiCorp, Inc.
## SPDX-License-Identifier: MPL-2.0
#
## This action creates downstream PRs for PRs with backport labels defined.
## See docs here: https://github.com/hashicorp/backport-assistant
#
#name: Backport Assistant Runner
#
#on:
# pull_request_target:
# types:
# - closed
# - labeled
# branches:
# - main
# - 'release/*.*.x'
#
#jobs:
# backport:
# if: github.event.pull_request.merged
# runs-on: ubuntu-latest
# container: hashicorpdev/backport-assistant:0.4.4
# steps:
# - name: Run Backport Assistant for release branches
# run: |
# backport-assistant backport -merge-method=squash
# env:
# BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+)"
# BACKPORT_TARGET_TEMPLATE: "release/{{.target}}.x"
# GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN_WORKFLOW }}
# ENABLE_VERSION_MANIFESTS: true
# backport-ent:
# if: github.event.pull_request.merged && contains(join(github.event.pull_request.labels.*.name), 'backport/ent')
# runs-on: ubuntu-latest
# steps:
# - name: Trigger backport for Enterprise
# uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
# with:
# token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
# repository: hashicorp/consul-enterprise
# event-type: ent-backport
# client-payload: ${{ toJson(github.event) }}
# handle-failure:
# needs:
# - backport
# - backport-ent
# if: always() && (needs.backport.result == 'failure' || needs.backport-ent.result == 'failure')
# runs-on: ubuntu-latest
# steps:
# - name: Comment on PR
# run: |
# github_message="Backport failed @${{ github.event.sender.login }}. Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# curl -s -H "Authorization: token ${{ secrets.PR_COMMENT_TOKEN }}" \
# -X POST \
# -d "{ \"body\": \"${github_message}\"}" \
# "https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${{ github.event.pull_request.number }}/comments"
#
70 changes: 35 additions & 35 deletions .github/workflows/backport-checker.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This workflow checks that there is either a 'pr/no-backport' label applied to a PR
# or there is a backport/* label indicating a backport has been set

name: Backport Checker

on:
pull_request:
types: [opened, synchronize, labeled]
# Runs on PRs to main and all release branches
branches:
- main
- release/*

jobs:
# checks that a backport label is present for a PR
backport-check:
# If there's a `pr/no-backport` label we ignore this check. Also, we ignore PRs created by the bot assigned to `backport-assistant`
if: "! ( contains(github.event.pull_request.labels.*.name, 'pr/no-backport') || github.event.pull_request.user.login == 'hc-github-team-consul-core' )"
runs-on: ubuntu-latest

steps:
- name: Check for Backport Label
run: |
labels="${{join(github.event.pull_request.labels.*.name, ', ') }}"
if [[ "$labels" =~ .*"backport/".* ]]; then
echo "Found backport label!"
exit 0
fi
# Fail status check when no backport label was found on the PR
echo "Did not find a backport label matching the pattern 'backport/*' and the 'pr/no-backport' label was not applied. Reference - https://github.com/hashicorp/consul/pull/16567"
exit 1
## Copyright (c) HashiCorp, Inc.
## SPDX-License-Identifier: MPL-2.0
#
## This workflow checks that there is either a 'pr/no-backport' label applied to a PR
## or there is a backport/* label indicating a backport has been set
#
#name: Backport Checker
#
#on:
# pull_request:
# types: [opened, synchronize, labeled]
# # Runs on PRs to main and all release branches
# branches:
# - main
# - release/*
#
#jobs:
# # checks that a backport label is present for a PR
# backport-check:
# # If there's a `pr/no-backport` label we ignore this check. Also, we ignore PRs created by the bot assigned to `backport-assistant`
# if: "! ( contains(github.event.pull_request.labels.*.name, 'pr/no-backport') || github.event.pull_request.user.login == 'hc-github-team-consul-core' )"
# runs-on: ubuntu-latest
#
# steps:
# - name: Check for Backport Label
# run: |
# labels="${{join(github.event.pull_request.labels.*.name, ', ') }}"
# if [[ "$labels" =~ .*"backport/".* ]]; then
# echo "Found backport label!"
# exit 0
# fi
# # Fail status check when no backport label was found on the PR
# echo "Did not find a backport label matching the pattern 'backport/*' and the 'pr/no-backport' label was not applied. Reference - https://github.com/hashicorp/consul/pull/16567"
# exit 1
#
32 changes: 16 additions & 16 deletions .github/workflows/bot-auto-approve.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Bot Auto Approve

on: pull_request_target

jobs:
auto-approve:
runs-on: ubuntu-latest
if: github.actor == 'hc-github-team-consul-core'
steps:
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
with:
review-message: "Auto approved Consul Bot automated PR"
github-token: ${{ secrets.MERGE_APPROVE_TOKEN }}
## Copyright (c) HashiCorp, Inc.
## SPDX-License-Identifier: MPL-2.0
#
#name: Bot Auto Approve
#
#on: pull_request_target
#
#jobs:
# auto-approve:
# runs-on: ubuntu-latest
# if: github.actor == 'hc-github-team-consul-core'
# steps:
# - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
# with:
# review-message: "Auto approved Consul Bot automated PR"
# github-token: ${{ secrets.MERGE_APPROVE_TOKEN }}
66 changes: 33 additions & 33 deletions .github/workflows/broken-link-check.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Broken Link Check

on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Run lychee link checker
id: lychee
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0
with:
args: ./website/content/docs/ --base https://developer.hashicorp.com/ --exclude-all-private --exclude '\.(svg|gif|jpg|png)' --exclude 'manage\.auth0\.com' --accept 403 --max-concurrency=24 --no-progress --verbose
# Fail GitHub action when broken links are found?
fail: false
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Create GitHub Issue From lychee output file
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
## Copyright (c) HashiCorp, Inc.
## SPDX-License-Identifier: MPL-2.0
#
#name: Broken Link Check
#
#on:
# workflow_dispatch:
# schedule:
# - cron: "0 0 1 * *"
#
#jobs:
# linkChecker:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
#
# - name: Run lychee link checker
# id: lychee
# uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0
# with:
# args: ./website/content/docs/ --base https://developer.hashicorp.com/ --exclude-all-private --exclude '\.(svg|gif|jpg|png)' --exclude 'manage\.auth0\.com' --accept 403 --max-concurrency=24 --no-progress --verbose
# # Fail GitHub action when broken links are found?
# fail: false
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
#
# - name: Create GitHub Issue From lychee output file
# if: env.lychee_exit_code != 0
# uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0
# with:
# title: Link Checker Report
# content-filepath: ./lychee/out.md
# labels: report, automated issue
Loading

0 comments on commit 0cb078f

Please sign in to comment.