From be7e46ba89fea13130e9e8a21c659dbc585418a9 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 14 Dec 2023 16:55:32 -0800 Subject: [PATCH] Add example workflow files --- README.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94630ea..27284f9 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,73 @@ Below are the allowed configuration options: ### Example workflows -TBD +#### Basic + +```yaml +--- +name: Weekly dependabot checks +on: + workflow_dispatch: + schedule: + - cron: '3 2 1 * *' + +permissions: + issues: write + +jobs: + evergreen: + name: evergreen + runs-on: ubuntu-latest + + steps: + - name: Run evergreen action + uses: github/evergreen@v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORGANIZATION: +``` + +#### Advanced + +```yaml +--- +name: Weekly dependabot checks +on: + workflow_dispatch: + schedule: + - cron: '3 2 1 * *' + +permissions: + issues: write + +jobs: + evergreen: + name: evergreen + runs-on: ubuntu-latest + + steps: + - shell: bash + run: | + # Get the current date + current_date=$(date +'%Y-%m-%d') + + # Calculate the previous month + previous_date=$(date -d "$current_date -7 day" +'%Y-%m-%d') + + echo "$previous_date..$current_date" + echo "one_week_ago=$previous_date >> "$GITHUB_ENV" + + - name: Run evergreen action + uses: github/evergreen@v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORGANIZATION: + EXEMPT_REPOS: "org_name/repo_name_1, org_name/repo_name_2" + TITLE: "Add dependabot configuration" + BODY: "Please add this dependabot configuration so that we can keep the dependencies in this repo up to date and secure. for help, contact XXX" + CREATED_AFTER_DATE: ${{ env.one_week_ago }} + +``` ## Local usage without Docker