-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d399ade
commit f55fc0e
Showing
6 changed files
with
60 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Release new action version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
TAG_NAME: | ||
description: "Tag name that the major tag will point to" | ||
required: true | ||
|
||
env: | ||
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_tag: | ||
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes | ||
# Remember to configure the releaseNewActionVersion environment with required approvers in the repository settings | ||
environment: | ||
name: releaseNewActionVersion | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Update the ${{ env.TAG_NAME }} tag | ||
uses: step-security/publish-action@b438f840875fdcb7d1de4fc3d1d30e86cf6acb5d | ||
with: | ||
source-tag: ${{ env.TAG_NAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
Please report security vulnerabilities to [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
from glob import glob | ||
from pathlib import Path | ||
from typing import List, Optional, Union, Mapping, Tuple, Any, Iterable, Callable | ||
|
||
import requests | ||
import github | ||
import humanize | ||
import psutil | ||
|
@@ -229,7 +229,22 @@ def action_fail_required(conclusion: str, action_fail: bool, action_fail_on_inco | |
action_fail_on_inconclusive and conclusion == 'inconclusive' | ||
|
||
|
||
def validate_subscription(): | ||
API_URL = f"https://agent.api.stepsecurity.io/v1/github/{os.environ['GITHUB_REPOSITORY']}/actions/subscription" | ||
|
||
try: | ||
response = requests.get(API_URL, timeout=3) | ||
response.raise_for_status() | ||
except requests.exceptions.HTTPError: | ||
print("Subscription is not valid. Reach out to [email protected]") | ||
exit(1) | ||
except requests.exceptions.RequestException: | ||
print("Timeout or API not reachable. Continuing to next step.") | ||
|
||
|
||
def main(settings: Settings, gha: GithubAction) -> None: | ||
validate_subscription() | ||
|
||
if settings.is_fork and not settings.job_summary: | ||
gha.warning(f'This action is running on a pull_request event for a fork repository. ' | ||
f'The only useful thing it can do in this situation is creating a job summary, which is disabled in settings. ' | ||
|