-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into megalinter
- Loading branch information
Showing
73 changed files
with
1,276 additions
and
5,610 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,16 @@ | ||
name: Enforce PR labels | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
enforce-label: | ||
if: ${{ contains(github.event.*.labels.*.name, 'hold') }} | ||
name: Enforce label | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check for label | ||
run: | | ||
echo "PRs with the hold label cannot be merged" | ||
echo "### :x: PRs with the hold label cannot be merged" >> $GITHUB_STEP_SUMMARY | ||
exit 1 |
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,104 @@ | ||
--- | ||
name: _version | ||
run-name: Calculate Version | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
is-release: | ||
type: boolean | ||
required: true | ||
outputs: | ||
version: | ||
description: "version to be built" | ||
value: ${{ jobs.version.outputs.version }} | ||
|
||
jobs: | ||
version: | ||
name: Calculate Version | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
version: ${{ steps.calculate.outputs.version }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get PR ID | ||
id: pr | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
commit_message=$( | ||
curl -s -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $GH_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} | \ | ||
jq -r ".commit.message" | ||
) | ||
ID=$(echo "$commit_message" | head -1 | grep -o "(#.*)" | grep -o "[0-9]*") | ||
echo "id=$ID" >> $GITHUB_OUTPUT | ||
- name: Get version bump type | ||
if: ${{ inputs.is-release }} | ||
id: bump-type | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ steps.pr.outputs.id }} | ||
run: | | ||
version_tag=$( | ||
curl -s -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $GH_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/labels | \ | ||
jq -r ".[].name" | grep "version" | ||
) | ||
# Single Version label Enforcement (should go in CI...) | ||
if [[ $(echo $version_tag | wc -w) -gt 1 ]]; then | ||
echo "[!] multiple version labels found!" | ||
exit 1 | ||
fi | ||
version_type=$(echo $version_tag | cut -d ":" -f 2) | ||
echo "Version Bump Type: $version_type" | ||
echo "type=$version_type" >> $GITHUB_OUTPUT | ||
- name: Calculate next version | ||
id: calculate | ||
env: | ||
VERSION_TYPE: ${{ steps.bump-type.outputs.type }} | ||
run: | | ||
echo -e "\nCalculating next version..." | ||
latest_tag_version=$(git tag --sort=committerdate --list | tail -1) | ||
latest_version=${latest_tag_version:1} # remove 'v' from tag version | ||
if [[ "${{ inputs.is-release }}" == "true" ]]; then | ||
latest_major_version=$(echo $latest_version | cut -d "." -f 1) | ||
latest_minor_version=$(echo $latest_version | cut -d "." -f 2) | ||
latest_patch_version=$(echo $latest_version | cut -d "." -f 3) | ||
echo " latest_version: $latest_version" | ||
echo " latest_major_version: $latest_major_version" | ||
echo " latest_minor_version: $latest_minor_version" | ||
echo " latest_patch_version: $latest_patch_version" | ||
if [[ "$VERSION_TYPE" == "major" ]]; then | ||
next_version="$(($latest_major_version + 1)).0.0" | ||
elif [[ "$VERSION_TYPE" == "minor" ]]; then | ||
next_version="${latest_major_version}.$(($latest_minor_version + 1)).0" | ||
elif [[ "$VERSION_TYPE" == "patch" ]]; then | ||
next_version="${latest_major_version}.${latest_minor_version}.$(($latest_patch_version + 1))" | ||
else | ||
next_version="$latest_version+${{ steps.pr.outputs.id }}" | ||
fi | ||
echo "Next Version: $next_version" | ||
echo "version=$next_version" >> $GITHUB_OUTPUT | ||
else | ||
echo "version=$latest_version+${{ steps.pr.outputs.id }}" >> $GITHUB_OUTPUT | ||
fi |
This file was deleted.
Oops, something went wrong.
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
22 changes: 22 additions & 0 deletions
22
.github/workflows/test-report-upcoming-release-version.yml
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,22 @@ | ||
--- | ||
name: Test report-upcoming release version to Slack | ||
on: | ||
pull_request: | ||
paths: | ||
- "report-upcoming-release-version/**" | ||
- ".github/workflows/test-report-upcoming-release-version.yml" | ||
|
||
jobs: | ||
test-report-upcoming-release-version: | ||
name: Test report upcoming release version to Slack | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Report upcoming release version to Slack | ||
uses: ./report-upcoming-release-version | ||
with: | ||
project: bitwarden/server | ||
version: upcoming_version | ||
slack-channel: bre-alerts-test | ||
AZURE_KV_CI_SERVICE_PRINCIPAL: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM crowdin/cli:3.16.0 | ||
FROM crowdin/cli:3.19.4 | ||
|
||
RUN apk --no-cache add curl git jq gnupg; | ||
|
||
|
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
Oops, something went wrong.