From 91d7269a07deeeb266362b4eee8555c061a9949f Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Tue, 27 Feb 2024 15:58:50 -0500 Subject: [PATCH] fix: make action standalone --- .github/actions/pr.yaml | 24 ++++++++++++++++++++++++ README.md | 3 ++- action.yaml | 10 ++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/actions/pr.yaml diff --git a/.github/actions/pr.yaml b/.github/actions/pr.yaml new file mode 100644 index 0000000..3502f9e --- /dev/null +++ b/.github/actions/pr.yaml @@ -0,0 +1,24 @@ +name: Test My GitHub Action + +on: + pull_request: + branches: [ main ] + +jobs: + test-my-action: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Symbols 📦 + uses: action.yaml + with: + clientId: "${{ secrets.SYMBOL_UPLOAD_CLIENT_ID }}" + clientSecret: "${{ secrets.SYMBOL_UPLOAD_CLIENT_SECRET }}" + database: "${{ secrets.BUGSPLAT_DATABASE }}" + application: "symbol-upload-test" + version: "1.0" + directory: "dist" + files: "**/*.js.map" + node-version: '21' diff --git a/README.md b/README.md index 41de6d3..99c507e 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,12 @@ You can use the `symbol-upload` action in your [GitHub Actions](https://github.c with: clientId: "${{ secrets.SYMBOL_UPLOAD_CLIENT_ID }}" clientSecret: "${{ secrets.SYMBOL_UPLOAD_CLIENT_SECRET }}" - database:"${{ secrets.BUGSPLAT_DATABASE }}" + database: "${{ secrets.BUGSPLAT_DATABASE }}" application: "your-application" version: "your-version" files: "**/*.{pdb,exe,dll}" directory: "your-build-directory" + node-version: "20" ``` Be sure to use [secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) so that you don't expose the values for `clientId`, `clientSecret`, and `database`. diff --git a/action.yaml b/action.yaml index 6d98d38..61fe400 100644 --- a/action.yaml +++ b/action.yaml @@ -44,10 +44,20 @@ inputs: description: "Base directory for files" type: string required: false + node-version: + description: "Node.js version to use" + type: string + required: false + default: '20' runs: using: composite steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + - name: Install symbol-upload shell: bash run: npm i -g @bugsplat/symbol-upload