From 21770cb2e42981e1c442d8a39740191ef92d479d Mon Sep 17 00:00:00 2001 From: Eyar Zilberman Date: Thu, 22 Dec 2022 16:40:59 +0200 Subject: [PATCH 1/2] ci: update workflows --- .github/workflows/check_pr_title.yml | 21 ------------- .github/workflows/cron_checks.yml | 45 +++++++++++++++++++++++++++ .github/workflows/files_existence.yml | 19 ----------- .github/workflows/pr_checks.yml | 37 ++++++++++++++++++++++ .github/workflows/pull_request.yml | 2 +- 5 files changed, 83 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/check_pr_title.yml create mode 100644 .github/workflows/cron_checks.yml delete mode 100644 .github/workflows/files_existence.yml create mode 100644 .github/workflows/pr_checks.yml diff --git a/.github/workflows/check_pr_title.yml b/.github/workflows/check_pr_title.yml deleted file mode 100644 index 0146a38842..0000000000 --- a/.github/workflows/check_pr_title.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: PR title -on: - pull_request: - types: - - opened - - edited - - synchronize - - reopened - -jobs: - check: - runs-on: ubuntu-latest - steps: - - name: checkout repo content - uses: actions/checkout@v3 - - name: setup python - uses: actions/setup-python@v4 - with: - python-version: '3.10.8' - - name: check PR title - run: python ./scripts/check_pr_title.py diff --git a/.github/workflows/cron_checks.yml b/.github/workflows/cron_checks.yml new file mode 100644 index 0000000000..2c147f2978 --- /dev/null +++ b/.github/workflows/cron_checks.yml @@ -0,0 +1,45 @@ +name: Cron checks +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale_issues: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + days-before-stale: 30 + days-before-pr-stale: -1 + days-before-close: 7 + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. + stale-issue-label: 'stale issue' + exempt-issue-labels: 'good first issue, WIP, question, up for grabs' + + dead_readme_links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Check links + uses: lycheeverse/lychee-action@v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: --verbose --no-progress --timeout 10 --max-concurrency 2 -- './**/*.md' + output: ./lychee/out.md + + - name: Get current date + id: date + run: echo "::set-output name=now::$(date +'%d-%m-%Y')" + + - name: Create issue when fail + if: ${{ steps.lychee.outputs.exit_code }} != 0 + uses: peter-evans/create-issue-from-file@v3 + with: + title: Automated Links Checker Report for ${{ steps.date.outputs.now }} + content-filepath: ./lychee/out.md + labels: documentation \ No newline at end of file diff --git a/.github/workflows/files_existence.yml b/.github/workflows/files_existence.yml deleted file mode 100644 index 0d1a0b9e32..0000000000 --- a/.github/workflows/files_existence.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Files existence - -on: - pull_request: - types: [ opened, edited, synchronize, reopened ] - -jobs: - file_existence: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Check if important files exist - id: check_files - uses: andstor/file-existence-action@v2 - with: - files: "pkg/defaultRules/defaultRules.yaml, pkg/defaultPolicies/defaultPolicies.yaml" - fail: true diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml new file mode 100644 index 0000000000..6f6276b183 --- /dev/null +++ b/.github/workflows/pr_checks.yml @@ -0,0 +1,37 @@ +name: PR checks + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +jobs: + check_file_existence: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Check if important files exist + id: check_files + uses: andstor/file-existence-action@v2 + with: + files: "pkg/defaultRules/defaultRules.yaml, pkg/defaultPolicies/defaultPolicies.yaml" + fail: true + + check_pr_title: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: '3.10.8' + + - name: Check if PR title matches the required format + run: python ./scripts/check_pr_title.py \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d8e6a46e14..99be3adeab 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -7,4 +7,4 @@ jobs: go_build_and_test: uses: ./.github/workflows/reusable_go_build.yml with: - goBuildTag: staging + goBuildTag: staging \ No newline at end of file From 8343b655ca0c373a059afbf24c7789bf7e9a2bdc Mon Sep 17 00:00:00 2001 From: Eyar Zilberman Date: Thu, 22 Dec 2022 16:42:08 +0200 Subject: [PATCH 2/2] ci: remove stale workflow --- .github/workflows/stale.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 4b762a7332..0000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Close stale issues' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v6 - with: - days-before-stale: 30 - days-before-pr-stale: -1 - days-before-close: 7 - stale-issue-message: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - stale-issue-label: 'stale issue' - exempt-issue-labels: 'good first issue, WIP, question, up for grabs'