Skip to content

chore(ci): automation security updates #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
value: |
Thank you for submitting a bug report. Please add as much information as possible to help us reproduce, and remove any potential sensitive data.

Please become familiar with [our definition of bug](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/MAINTAINERS.md#is-that-a-bug).
Please become familiar with [our definition of bug](https://github.com/awslabs/aws-lambda-powertools-dotnet/blob/develop/MAINTAINERS.md#is-that-a-bug).
- type: textarea
id: expected_behaviour
attributes:
Expand Down Expand Up @@ -79,8 +79,8 @@ body:
id: logs
attributes:
label: Debugging logs
description: If available, please share [debugging logs](https://awslabs.github.io/aws-lambda-powertools-python/#debug-mode)
render: python
description: If available, please share [debugging logs](https://awslabs.github.io/aws-lambda-powertools-dotnet/#debug-mode)
render: csharp
validations:
required: false
- type: markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ body:
attributes:
label: Acknowledgment
options:
- label: This feature request meets [Lambda Powertools Tenets](https://awslabs.github.io/aws-lambda-powertools-python/latest/#tenets)
- label: This feature request meets [Lambda Powertools Tenets](https://awslabs.github.io/aws-lambda-powertools-dotnet/tenets)
required: true
- label: Should this be considered in other Lambda Powertools languages? i.e. [Java](https://github.com/awslabs/aws-lambda-powertools-java/), [TypeScript](https://github.com/awslabs/aws-lambda-powertools-typescript/)
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Please leave checklist items unchecked if they do not apply to your change.

* [ ] [Meets tenets criteria](https://awslabs.github.io/aws-lambda-powertools-python/#tenets)
* [ ] [Meets tenets criteria](https://awslabs.github.io/aws-lambda-powertools-dotnet/tenets)
* [ ] I have performed a self-review of this change
* [ ] Changes have been tested
* [ ] Changes are documented
Expand Down
8 changes: 4 additions & 4 deletions .github/scripts/constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = Object.freeze({
/** @type {string} */
// Values: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
"PR_ACTION": process.env.PR_ACTION || "",
"PR_ACTION": process.env.PR_ACTION?.replace(/"/g, '') || "",

/** @type {string} */
"PR_AUTHOR": process.env.PR_AUTHOR?.replace(/"/g, '') || "",
Expand All @@ -24,7 +24,7 @@ module.exports = Object.freeze({
/** @type {string} */
"LABEL_BLOCK_REASON": "need-issue",

// /** @type {string} */
/** @type {string} */
"LABEL_PENDING_RELEASE": "pending-release",

/** @type {string} */
Expand All @@ -37,6 +37,6 @@ module.exports = Object.freeze({
"AREAS": [
"tracing",
"metrics",
"logger",
"logging",
],
});
});
10 changes: 10 additions & 0 deletions .github/scripts/label_related_issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ module.exports = async ({github, context, core}) => {
core.setFailed(`Is this issue number (${issue}) valid? Perhaps a discussion?`);
throw new Error(error);
}

const { groups: {relatedIssueNumber} } = isMatch

core.info(`Auto-labeling related issue ${relatedIssueNumber} for release`)
return await github.rest.issues.addLabels({
issue_number: relatedIssueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [relatedIssueNumber]
})
}
3 changes: 2 additions & 1 deletion .github/workflows/label_pr_on_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
label_pr:
Expand All @@ -34,4 +35,4 @@ jobs:
# and label PR based on semantic title accordingly
script: |
const script = require('.github/scripts/label_pr_based_on_title.js')
await script({github, context, core})
await script({github, context, core})
1 change: 1 addition & 0 deletions .github/workflows/on_merged_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
release_label_on_merge:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on_opened_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ jobs:
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
check_related_issue:
needs: get_pr_details
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Debug workflow_run event"
run: echo "${{ github }}"
- name: "Ensure related issue is present"
uses: actions/github-script@v6
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/record_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: pr
path: pr.txt
path: pr.txt
5 changes: 5 additions & 0 deletions .github/workflows/reusable_export_pr_details.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
record_pr_workflow_id:
required: true
type: number
workflow_origin: # see https://github.com/awslabs/aws-lambda-powertools-python/issues/1349
required: true
type: string
secrets:
token:
required: true
Expand All @@ -32,6 +35,8 @@ on:

jobs:
export_pr_details:
# see https://github.com/awslabs/aws-lambda-powertools-python/issues/1349
if: inputs.workflow_origin == 'awslabs/aws-lambda-powertools-dotnet'
runs-on: ubuntu-latest
env:
FILENAME: pr.txt
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @awslabs/aws-lambda-powertools-net
Loading