Skip to content

Commit

Permalink
Merge pull request #61 from awslabs/github-wf
Browse files Browse the repository at this point in the history
daily tag gh flow added
  • Loading branch information
vara-bonthu authored Nov 12, 2022
2 parents 3a80cdf + 0d1f651 commit da17069
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/daily-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Create daily tags

on:
workflow_dispatch:
schedule:
- cron: "0 1 * * *" # min(0 - 59) hour(0 - 23) day of the month (1 - 31) month (1 - 12 or JAN-DEC) day of the week (0 - 6 or SUN-SAT)

permissions:
contents: write

jobs:
daily-tag:
name: "Create tag on main for changes in last 24 hours"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: "Get changes and create TAG"
run: |
CHANGES=$(git log --since="1 day ago" --name-only --pretty=format: )
if [ "x$CHANGES" != "x" ] ; then
TAG="daily-$(date +%Y.%m.%d)"
git tag $TAG
git push origin $TAG
echo "Created a new tag: $TAG"
else
echo "No changes identified in last 24 hours"
fi
21 changes: 21 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Dependabot auto-merge

on:
pull_request_target:
branches: [ main ]
types: [ opened ]

permissions:
pull-requests: write
contents: write

jobs:
enableAutoMerge:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit da17069

Please sign in to comment.