Skip to content

Commit

Permalink
Merge pull request #106 from microsoft/release/vNext
Browse files Browse the repository at this point in the history
Workflow to compile TypeScript and commit resulting JavaScript
  • Loading branch information
chrisnielsen-MS authored Jul 31, 2024
2 parents 52f2370 + b3e48a2 commit 1a70159
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/official-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: security-devops-action Official Build

on:
pull_request:
branches:
- release/vNext

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Configure npm to use GitHub Packages
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install dependencies
run: npm install

- name: Compile TypeScript
run: npm run build

- name: Commit compiled JavaScript
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add lib/.
git commit -m 'Official Build: Compile TypeScript to JavaScript'
git push --force origin HEAD:${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions lib/msdo-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var Tools;
(function (Tools) {
Tools["Bandit"] = "bandit";
Tools["Binskim"] = "binskim";
Tools["Checkov"] = "checkov";
Tools["ContainerMapping"] = "container-mapping";
Tools["ESLint"] = "eslint";
Tools["TemplateAnalyzer"] = "templateanalyzer";
Expand Down
1 change: 1 addition & 0 deletions src/msdo-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum RunnerType {
export enum Tools {
Bandit = 'bandit',
Binskim = 'binskim',
Checkov = 'checkov',
ContainerMapping = 'container-mapping',
ESLint = 'eslint',
TemplateAnalyzer = 'templateanalyzer',
Expand Down

0 comments on commit 1a70159

Please sign in to comment.