Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add dependabot + other standard Bicep project config (#142)
  • Loading branch information
anthony-c-martin committed Jan 24, 2024
1 parent 95b309a commit 7e7091d
Show file tree
Hide file tree
Showing 23 changed files with 5,547 additions and 393 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/bug-report---feature-request.md

This file was deleted.

47 changes: 0 additions & 47 deletions .github/config/labels.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
72 changes: 72 additions & 0 deletions .github/policies/issueMgmt.recentActivity.yml
@@ -0,0 +1,72 @@
id: issueMgmt.recentActivity
name: GitOps.PullRequestIssueManagement
description: Manages recent activity on issues - closes stale issues, adds updated issues to triage
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: "Close issues with 'Status: No Recent Activity'"
frequencies:
- hourly:
hour: 12
filters:
- isIssue
- isOpen
- hasLabel:
label: "Needs: Author Feedback"
- hasLabel:
label: "Status: No Recent Activity"
- noActivitySince:
days: 3
actions:
- closeIssue

- description: "Add 'Status: No Recent Activity' label to issues with 'Needs: Author Feedback' and inactive"
frequencies:
- hourly:
hour: 12
filters:
- isIssue
- isOpen
- hasLabel:
label: "Needs: Author Feedback"
- noActivitySince:
days: 7
- isNotLabeledWith:
label: "Status: No Recent Activity"
actions:
- addLabel:
label: "Status: No Recent Activity"
- addReply:
reply: "Hi @${issueAuthor}, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 3 days of this comment**. Thanks for contributing to bicep! :smile: :mechanical_arm:"

eventResponderTasks:
- description: "Replace 'Needs: Author Feedback' with 'Needs: Triage' label when author comments"
if:
- payloadType: Issue_Comment
- isAction:
action: Created
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Author Feedback"
- isOpen
then:
- addLabel:
label: "Needs: Triage :mag:"
- removeLabel:
label: "Needs: Author Feedback"

- description: "Remove 'Status: No Recent Activity' label when an issue is commented on"
if:
- payloadType: Issue_Comment
- hasLabel:
label: "Status: No Recent Activity"
then:
- removeLabel:
label: "Status: No Recent Activity"
onFailure:
onSuccess:
20 changes: 20 additions & 0 deletions .github/policies/issueMgmt.triageNew.yml
@@ -0,0 +1,20 @@
id: issueMgmt.triageNew
name: GitOps.PullRequestIssueManagement
description: Adds a triage tag to new issues
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: "Adds 'Needs: Triage' label for new issues"
if:
- payloadType: Issues
- isAction:
action: Opened
then:
- addLabel:
label: "Needs: Triage :mag:"
onFailure:
onSuccess:
30 changes: 30 additions & 0 deletions .github/policies/prMgmt.dependabot.yml
@@ -0,0 +1,30 @@
id: prMgmt.dependabot
name: GitOps.PullRequestIssueManagement
description: Approves and merges Dependabot PRs
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Approve PRs submitted by dependabot with the "dependencies" label
if:
- payloadType: Pull_Request
- hasLabel:
label: dependencies
- not:
hasLabel:
label: auto-merge
- isActivitySender:
user: dependabot[bot]
issueAuthor: False
then:
- approvePullRequest:
comment: ":shipit:"
- addLabel:
label: auto-merge
- enableAutoMerge:
mergeMethod: Squash
onFailure:
onSuccess:
17 changes: 0 additions & 17 deletions .github/workflows/add-labels.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .github/workflows/build-release.yaml
Expand Up @@ -17,15 +17,12 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x"
node-version: "20.x"

- run: sudo npm i -g @zeit/ncc

- run: npm install --production
- run: npm ci

- name: Compile files
run: |
ncc build -C -m src/entrypoint.ts
run: npm run package

- name: Commit Files
continue-on-error: true # commit will fail if the code wasn't changed. Prevent the build to fail in this case.
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/check-dist.yml
@@ -0,0 +1,35 @@
name: Check dist

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run package

- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff

0 comments on commit 7e7091d

Please sign in to comment.