Skip to content

Commit

Permalink
Updating workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
TGWolf committed Sep 9, 2022
1 parent e2f1d08 commit 0621fa5
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/ask_question.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Ask a question
description: If you don't have a specific issue or bug to report you can still ask us questions and we will do our best to answer them
title: "[Question]: "
labels: [question, triage]
labels: ["type: question", "state: triage"]
assignees:
- tgwolf
body:
Expand All @@ -16,7 +16,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/AWSToolbox/list-rds-instances/blob/master/.github/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Report a bug
description: Found a bug? Let us knonw what the issue is and we will attempt to fix it
title: "[Bug]: "
labels: [bug, triage]
labels: ["type: bug", "state: triage"]
assignees:
- tgwolf
body:
Expand Down Expand Up @@ -52,7 +52,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/AWSToolbox/list-rds-instances/blob/master/.github/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Request a new feature
description: Got an idea for a new feature? Let us know what you want and we will see if we can add it
title: "[Feature Request]: "
labels: [enhancement, triage]
labels: ["type: feature", "state: triage"]
assignees:
- tgwolf
body:
Expand Down Expand Up @@ -37,7 +37,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/AWSToolbox/list-rds-instances/blob/master/.github/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"

- package-ecosystem: "pip"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
Original file line number Diff line number Diff line change
@@ -1,97 +1,102 @@
name: pipeline
name: CICD Pipeline
on: [push, pull_request]

jobs:
bandit:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ '3.6', '3.7', '3.8', '3.9' ]
python: [ '3.7', '3.8', '3.9', '3.10' ]
name: Bandit Test on Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Run Bandit
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/bandit/master/pipeline.sh)
pur:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ '3.6', '3.7', '3.8', '3.9' ]
name: Pur Test on Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Run Pur
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pur/master/pipeline.sh)
# pur:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python: [ '3.7', '3.8', '3.9', '3.10' ]
# name: Pur Test on Python ${{ matrix.python }}
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}
# - name: Run Pur
# run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pur/master/pipeline.sh)
pycodestyle:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ '3.6', '3.7', '3.8', '3.9' ]
python: [ '3.7', '3.8', '3.9', '3.10' ]
name: Pycodestyle Test on Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Run Pycodestyle
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pycodestyle/master/pipeline.sh)

awesomebot:
name: Awesomebot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.0
- uses: actions/checkout@v3
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.1
- name: Run Awesomebot
env:
FLAGS: "default"
EXCLUDE_FILES: "CHANGELOG.md"
WHITELIST: "https://img.shields.io"
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/awesomebot/master/pipeline.sh)

shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run Shellcheck
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/shellcheck/master/pipeline.sh)

yaml-lint:
name: YAML Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.0
- uses: actions/checkout@v3
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.1
- name: Run YAML-Lint
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/yaml-lint/master/pipeline.sh)

slack-workflow-status:
if: always()
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
name: Slack Post Workflow Notification
needs:
- bandit
- pur
# - pur
- pycodestyle
- awesomebot
- shellcheck
- yaml-lint
runs-on: ubuntu-latest
steps:
- name: Slack Post Workflow Notification
uses: Gamesight/slack-workflow-status@master
- name: Slack Workflow Notifications
uses: Gamesight/slack-workflow-status@v1.1.0
with:
include_jobs: true
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
include_jobs: on-failure
include_commit_message: true
33 changes: 33 additions & 0 deletions .github/workflows/delete-old-runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Delete old workflow runs
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days.'
required: true
default: 30
minimum_runs:
description: 'The minimum runs to keep for each workflow.'
required: true
default: 6
schedule:
- cron: '0 4 * * *'

jobs:
delete_old_workflows:
runs-on: ubuntu-latest
steps:
- name: Set the variables
env:
DEFAULT_DAYS: 14
DEFAULT_MINIMUM_RUNS: 3
run: |
echo "DAYS=${{ github.event.inputs.days || env.DEFAULT_DAYS }}" >> $GITHUB_ENV
echo "MINIMUM_RUNS=${{ github.event.inputs.minimum_runs || env.DEFAULT_MINIMUM_RUNS }}" >> $GITHUB_ENV
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
retain_days: ${{ env.DAYS }}
keep_minimum_runs: ${{ env.MINIMUM_RUNS }}
35 changes: 35 additions & 0 deletions .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dependabot pull request approve and merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
# Checking the actor will prevent your Action run failing on non-Dependabot
# PRs but also ensures that it only does work for Dependabot PRs.
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
# This first step will fail if there's no metadata and so the approval
# will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Here the PR gets approved.
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Finally, this sets the PR to allow auto-merging for patch and minor
# updates if all checks pass
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/handle-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Stale issue/pr handler
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'

permissions:
issues: write
pull-requests: write

jobs:
handle-stale-entries:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
id: stale
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
days-before-issue-stale: 30
days-before-issue-close: 5
stale-issue-label: 'state: stale'
close-issue-label: 'resolution closed'
exempt-issue-labels: 'state: blocked,state: keep'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
days-before-pr-stale: 45
days-before-pr-close: 10
stale-pr-label: 'state: stale'
close-pr-label: 'resolution: closed'
exempt-pr-labels: 'state: blocked,state: keep'
- name: Print outputs
run: echo ${{ join(steps.stale.outputs.*, ',') }}
13 changes: 13 additions & 0 deletions .github/workflows/purge-obsolete-runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Purge obsolete workflow runs
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'

jobs:
purge_obsolete_workflows:
runs-on: ubuntu-latest
steps:
- uses: otto-contentfactory/purge-workflow-runs@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/.DS-Store
**/ab-results*
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This changelog was automatically generated using [Caretaker](https://github.com/

### [Unreleased](https://github.com/AWSToolbox/list-rds-instances/compare/v0.1.1...HEAD)

- rebrand [`[head]`](https://github.com/AWSToolbox/list-rds-instances/commit/)
- Updating workflows [`[head]`](https://github.com/AWSToolbox/list-rds-instances/commit/)

- rebrand [`[e2f1d08]`](https://github.com/AWSToolbox/list-rds-instances/commit/e2f1d08f1780474db5a7981693cb490f0b0afbe9)

- Fix pur issues from travis [`[ba33d6c]`](https://github.com/AWSToolbox/list-rds-instances/commit/ba33d6cdc497c94b9cda872b79fe0cd2598dd2fb)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)
=====================

Copyright © `2009-2021` `Wolf Software`
Copyright © `2009-2022` `Wolf Software`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
17 changes: 0 additions & 17 deletions stale.yml

This file was deleted.

0 comments on commit 0621fa5

Please sign in to comment.