Skip to content

ci: roll back changes from ci main #11

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 1 commit into from
Aug 14, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
node-version: '14'

- name: Install tfx-cli and typescript
run: |
Expand Down
42 changes: 12 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,58 +32,40 @@ jobs:
npm install -g typescript

- name: Login to Azure DevOps
uses: azure/login@v2
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_APPLICATION_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Get Azure DevOps access token
id: devops_token
id: get_token
run: |
TOKEN="$(az account get-access-token --resource "${{ secrets.AZURE_MARKETPLACE_ACCESS_SCOPE }}" --query accessToken -o tsv)"
echo "::add-mask::$TOKEN"
echo "azure_devops_access_token=$TOKEN" >> "$GITHUB_OUTPUT"
echo "AZURE_DEVOPS_ACCESS_TOKEN=$(az account get-access-token --resource ${{ secrets.AZURE_MARKETPLACE_ACCESS_SCOPE }} --query accessToken -o tsv)" >> $GITHUB_ENV

- name: Build release
run: |
make build

- name: Increment version
id: bump
run: |
chmod +x ./bump_version.sh
NEW_VERSION="$(./bump_version.sh)"
if [[ -z "$NEW_VERSION" ]]; then
echo "Version bump script returned empty version" >&2
exit 1
fi
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
NEW_VERSION=$(./bump_version.sh)
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV

- name: Publish release
env:
AZURE_DEVOPS_ACCESS_TOKEN: ${{ steps.devops_token.outputs.azure_devops_access_token }}
AZURE_DEVOPS_ACCESS_TOKEN: ${{ env.AZURE_DEVOPS_ACCESS_TOKEN }}
run: |
make publish-release

- name: Commit version increment
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

git add ./sysdig-cli-scan-task/task.json ./VERSION ./vss-extension.json
if git diff --cached --quiet; then
echo "No changes to commit."
exit 0
fi

VERSION="${{ steps.bump.outputs.new_version }}"
git commit -m "chore: bump version to ${VERSION}"
if git tag -l "${VERSION}" | grep -q "^${VERSION}$"; then
echo "Tag ${VERSION} already exists, skipping tag creation."
else
git tag -a "${VERSION}" -m "Release ${VERSION}"
fi

git push origin HEAD
git push origin "${VERSION}"
git add ./sysdig-cli-scan-task/task.json
git add ./VERSION
git add ./vss-extension.json
git commit -m "Increment version to ${{ env.NEW_VERSION }}"
git tag ${{ env.NEW_VERSION }}
git push origin HEAD --tags
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ AZURE_DEVOPS_ACCESS_TOKEN ?=
all: build

build:
npm ci
cd $(TYPESCRIPT_SOURCE) && npm ci && tsc
npm install
cd $(TYPESCRIPT_SOURCE) && npm install && tsc

publish-local: build
tfx extension publish \
Expand Down