From b17518ed08836cc61a9f7958c3dccb656d9f2634 Mon Sep 17 00:00:00 2001 From: amutechtest Date: Wed, 1 Nov 2023 09:04:57 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=84=20Synchronize=20with=20@Andrew?= =?UTF-8?q?s-McMeel-Universal/action=5Ftemplate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 14 +-- .github/release.yml | 13 ++- .github/workflows/dependabot-automations.yml | 6 +- .github/workflows/pr-checks.yml | 2 +- .github/workflows/pr-clean-caches.yml | 2 +- .gitignore | 35 +++---- .prettierignore | 5 +- action.yaml | 96 ++------------------ 8 files changed, 46 insertions(+), 127 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8ac8526..ce05a1c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,17 +1,17 @@ - ## Description -## Related Issues +## Related Links - + + +- Jira Issue: JIRA-XXX diff --git a/.github/release.yml b/.github/release.yml index 35d1358..a8436cf 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,17 +1,24 @@ changelog: categories: - - title: General Changes + - title: 🌐 General Changes labels: - "*" exclude: authors: - dependabot - - title: DevOps Changes + labels: + - sync + - devops + - title: 🔨 DevOps Changes labels: - devops exclude: labels: - dependencies - - title: Dependencies + - sync + - title: 🔄 Template Syncs + labels: + - sync + - title: ⬆️ Dependencies labels: - dependencies diff --git a/.github/workflows/dependabot-automations.yml b/.github/workflows/dependabot-automations.yml index 469dc33..80ac415 100644 --- a/.github/workflows/dependabot-automations.yml +++ b/.github/workflows/dependabot-automations.yml @@ -1,4 +1,4 @@ -name: Dependabot Automations +name: 🤖 Dependabot Automations on: pull_request_target: @@ -10,10 +10,6 @@ permissions: contents: write repository-projects: write -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: dependabot-automations: if: ${{ github.actor == 'dependabot[bot]' }} diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index a5c8687..a5b0b2d 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -1,4 +1,4 @@ -name: PR Checks +name: ✅ PR Checks on: pull_request: diff --git a/.github/workflows/pr-clean-caches.yml b/.github/workflows/pr-clean-caches.yml index 53c4cd3..9a8e4f5 100644 --- a/.github/workflows/pr-clean-caches.yml +++ b/.github/workflows/pr-clean-caches.yml @@ -1,4 +1,4 @@ -name: Cleanup caches +name: 🗑️ Cleanup caches on: pull_request: diff --git a/.gitignore b/.gitignore index 4f6097f..ad3ad49 100644 --- a/.gitignore +++ b/.gitignore @@ -267,9 +267,15 @@ jscpd-report.json # Output of 'npm pack' *.tgz -# Yarn Integrity file +# Yarn Package Management .yarn-integrity yarn-error.log +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions # Configs configFile.json @@ -465,9 +471,6 @@ nCrunchTemp_* *.mm.* AutoTest.Net/ -# Web workbench (sass) -.sass-cache/ - # Installshield output folder [Ee]xpress/ @@ -588,7 +591,6 @@ FakesAssemblies/ # Node.js Tools for Visual Studio .ntvs_analysis.dat -node_modules/ # Visual Studio 6 build log *.plg @@ -606,10 +608,6 @@ node_modules/ *.dsw *.dsp -# Visual Studio 6 technical files -*.ncb -*.aps - # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -694,10 +692,7 @@ FodyWeavers.xsd # Windows Installer files from build outputs *.cab -*.msi *.msix -*.msm -*.msp # JetBrains Rider *.sln.iml @@ -708,7 +703,6 @@ FodyWeavers.xsd # https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore # by default all files in this directory should be ignored in Git -.vscode/* *devcontainer.env # these rules can be shared with collaborators @@ -727,10 +721,6 @@ FodyWeavers.xsd /.pnp .pnp.js -# generated during build -robots.txt -sitemap*.xml - # misc .DS_Store @@ -760,3 +750,14 @@ Secrets.json # Azure B2C /**/src/custom-policies/B2C_1A_*_*_SIGNINSIGNOUT_*.xml /custom-policies/**/B2C_1A_*_*_SIGNINSIGNOUT_*.xml + +# Azure Functions +*.Functions/Properties/ServiceDependencies/*/*.json +*.Functions/Properties/serviceDependencies.*.json + +# Terraform +terraform/.terraform.lock.hcl +terraform/.terraform/ +terraform/*.tfstate* +terraform/*.tfplan +terraform/variables.tf \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 64b19f6..6228294 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,10 +4,7 @@ # GitHub Actions Workflows -.github/dependabot.yml -.github/labeler.yml -.github/workflows/aks*.yml -.github/release.yml +.github/ # Helm deployments/**/templates/ diff --git a/action.yaml b/action.yaml index 236940e..45771cd 100644 --- a/action.yaml +++ b/action.yaml @@ -1,94 +1,12 @@ -name: "Cache Yarn Install" -description: "Run yarn install with node_modules linker and cache enabled" -inputs: - cwd: - description: "Changes node's process.cwd() if the project is not located on the root. Default to process.cwd()" - required: false - default: "." - cache-prefix: - description: "Add a specific cache-prefix" - required: false - default: "default" - cache-npm-cache: - description: "Cache npm global cache folder often used by node-gyp, prebuild binaries (invalidated on lock/os/node-version)" - required: false - default: "true" - cache-node-modules: - description: "Cache node_modules, might speed up link step (invalidated lock/os/node-version/branch)" - required: false - default: "false" - cache-install-state: - description: "Cache yarn install state, might speed up resolution step when node-modules cache is activated (invalidated lock/os/node-version/branch)" - required: false - default: "false" - enable-corepack: - description: "Enable corepack" - required: false - default: "true" +name: Default GitHub Action +description: Default GitHub Action that outputs "Hello World" + +branding: + color: purple + icon: unlock runs: using: "composite" steps: - - name: Enable Corepack - if: inputs.enable-corepack == 'true' - shell: bash - working-directory: ${{ inputs.cwd }} - run: corepack enable - - - name: Expose yarn config as "$GITHUB_OUTPUT" - id: yarn-config - shell: bash - working-directory: ${{ inputs.cwd }} - env: - YARN_ENABLE_GLOBAL_CACHE: "false" - run: | - echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - echo "CURRENT_NODE_VERSION="node-$(node --version)"" >> $GITHUB_OUTPUT - echo "CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's,/,-,g')" >> $GITHUB_OUTPUT - echo "NPM_GLOBAL_CACHE_FOLDER=$(npm config get cache)" >> $GITHUB_OUTPUT - - - name: Restore yarn cache - uses: actions/cache@v3 - id: yarn-download-cache - with: - path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }} - key: yarn-download-cache-${{ inputs.cache-prefix }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} - restore-keys: | - yarn-download-cache-${{ inputs.cache-prefix }}- - - - name: Restore node_modules - if: inputs.cache-node-modules == 'true' - id: yarn-nm-cache - uses: actions/cache@v3 - with: - path: ${{ inputs.cwd }}/**/node_modules - key: yarn-nm-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ steps.yarn-config.outputs.CURRENT_BRANCH }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} - - - name: Restore global npm cache folder - if: inputs.cache-npm-cache == 'true' - id: npm-global-cache - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-config.outputs.NPM_GLOBAL_CACHE_FOLDER }} - key: npm-global-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} - - - name: Restore yarn install state - if: inputs.cache-install-state == 'true' && inputs.cache-node-modules == 'true' - id: yarn-install-state-cache - uses: actions/cache@v3 - with: - path: ${{ inputs.cwd }}/.yarn/ci-cache - key: yarn-install-state-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ steps.yarn-config.outputs.CURRENT_BRANCH }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} - - - name: Install dependencies + - run: echo "Hello World" >> $GITHUB_OUTPUT shell: bash - working-directory: ${{ inputs.cwd }} - run: yarn install --immutable --inline-builds - env: - # Overrides/align yarnrc.yml options (v3, v4) for a CI context - YARN_ENABLE_GLOBAL_CACHE: "false" # Use local cache folder to keep downloaded archives - YARN_ENABLE_MIRROR: "false" # Prevent populating global cache for caches misses (local cache only) - YARN_NM_MODE: "hardlinks-local" # Reduce node_modules size - YARN_INSTALL_STATE_PATH: ".yarn/ci-cache/install-state.gz" # Might speed up resolution step when node_modules present - # Other environment variables - HUSKY: "0" # By default do not run HUSKY install From 72982575fa26e6fcbbaa1d8d02f3ae50740c6ecd Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:43:17 -0500 Subject: [PATCH 2/3] Reverting template syncing changes --- .github/.templatesyncignore | 5 +- action.yaml | 96 ++++++++++++++++++++++++++++++++++--- 2 files changed, 91 insertions(+), 10 deletions(-) diff --git a/.github/.templatesyncignore b/.github/.templatesyncignore index 719b06b..322e065 100644 --- a/.github/.templatesyncignore +++ b/.github/.templatesyncignore @@ -1,5 +1,4 @@ .github/CODEOWNERS .github/workflows/template-sync.yml -*.ps1 -README.md -Secrets-example.json \ No newline at end of file +action.yaml +README.md \ No newline at end of file diff --git a/action.yaml b/action.yaml index 45771cd..236940e 100644 --- a/action.yaml +++ b/action.yaml @@ -1,12 +1,94 @@ -name: Default GitHub Action +name: "Cache Yarn Install" +description: "Run yarn install with node_modules linker and cache enabled" +inputs: + cwd: + description: "Changes node's process.cwd() if the project is not located on the root. Default to process.cwd()" + required: false + default: "." + cache-prefix: + description: "Add a specific cache-prefix" + required: false + default: "default" + cache-npm-cache: + description: "Cache npm global cache folder often used by node-gyp, prebuild binaries (invalidated on lock/os/node-version)" + required: false + default: "true" + cache-node-modules: + description: "Cache node_modules, might speed up link step (invalidated lock/os/node-version/branch)" + required: false + default: "false" + cache-install-state: + description: "Cache yarn install state, might speed up resolution step when node-modules cache is activated (invalidated lock/os/node-version/branch)" + required: false + default: "false" + enable-corepack: + description: "Enable corepack" + required: false + default: "true" -description: Default GitHub Action that outputs "Hello World" - -branding: - color: purple - icon: unlock runs: using: "composite" steps: - - run: echo "Hello World" >> $GITHUB_OUTPUT + - name: Enable Corepack + if: inputs.enable-corepack == 'true' + shell: bash + working-directory: ${{ inputs.cwd }} + run: corepack enable + + - name: Expose yarn config as "$GITHUB_OUTPUT" + id: yarn-config + shell: bash + working-directory: ${{ inputs.cwd }} + env: + YARN_ENABLE_GLOBAL_CACHE: "false" + run: | + echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + echo "CURRENT_NODE_VERSION="node-$(node --version)"" >> $GITHUB_OUTPUT + echo "CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's,/,-,g')" >> $GITHUB_OUTPUT + echo "NPM_GLOBAL_CACHE_FOLDER=$(npm config get cache)" >> $GITHUB_OUTPUT + + - name: Restore yarn cache + uses: actions/cache@v3 + id: yarn-download-cache + with: + path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }} + key: yarn-download-cache-${{ inputs.cache-prefix }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} + restore-keys: | + yarn-download-cache-${{ inputs.cache-prefix }}- + + - name: Restore node_modules + if: inputs.cache-node-modules == 'true' + id: yarn-nm-cache + uses: actions/cache@v3 + with: + path: ${{ inputs.cwd }}/**/node_modules + key: yarn-nm-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ steps.yarn-config.outputs.CURRENT_BRANCH }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} + + - name: Restore global npm cache folder + if: inputs.cache-npm-cache == 'true' + id: npm-global-cache + uses: actions/cache@v3 + with: + path: ${{ steps.yarn-config.outputs.NPM_GLOBAL_CACHE_FOLDER }} + key: npm-global-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} + + - name: Restore yarn install state + if: inputs.cache-install-state == 'true' && inputs.cache-node-modules == 'true' + id: yarn-install-state-cache + uses: actions/cache@v3 + with: + path: ${{ inputs.cwd }}/.yarn/ci-cache + key: yarn-install-state-cache-${{ inputs.cache-prefix }}-${{ runner.os }}-${{ steps.yarn-config.outputs.CURRENT_NODE_VERSION }}-${{ steps.yarn-config.outputs.CURRENT_BRANCH }}-${{ hashFiles(format('{0}/yarn.lock', inputs.cwd), format('{0}/.yarnrc.yml', inputs.cwd)) }} + + - name: Install dependencies shell: bash + working-directory: ${{ inputs.cwd }} + run: yarn install --immutable --inline-builds + env: + # Overrides/align yarnrc.yml options (v3, v4) for a CI context + YARN_ENABLE_GLOBAL_CACHE: "false" # Use local cache folder to keep downloaded archives + YARN_ENABLE_MIRROR: "false" # Prevent populating global cache for caches misses (local cache only) + YARN_NM_MODE: "hardlinks-local" # Reduce node_modules size + YARN_INSTALL_STATE_PATH: ".yarn/ci-cache/install-state.gz" # Might speed up resolution step when node_modules present + # Other environment variables + HUSKY: "0" # By default do not run HUSKY install From cf3642305a627632c5725985711dac4581bcaa85 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:43:25 -0500 Subject: [PATCH 3/3] Manual sync with action_template --- .github/workflows/template-sync.yml | 4 ++-- .gitignore | 5 +++++ README.md | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/template-sync.yml b/.github/workflows/template-sync.yml index 5bbe3d6..41f7626 100644 --- a/.github/workflows/template-sync.yml +++ b/.github/workflows/template-sync.yml @@ -2,7 +2,7 @@ name: 🔄 Sync with action_template repository on: schedule: - - cron: 0 9 1 * * + - cron: 0 9 1 JAN,APR,JUL,OCT * workflow_dispatch: inputs: isdryrun: @@ -26,7 +26,7 @@ jobs: github_token: ${{ secrets.PAT_ACTION_CI }} source_repo_path: Andrews-McMeel-Universal/action_template upstream_branch: main - pr_labels: maintenance + pr_labels: sync pr_commit_msg: 🔄 Synchronize with @Andrews-McMeel-Universal/action_template pr_title: 🔄 Sync with @Andrews-McMeel-Universal/action_template pr_branch_name_prefix: sync/action_template/ diff --git a/.gitignore b/.gitignore index ad3ad49..9a8e9b7 100644 --- a/.gitignore +++ b/.gitignore @@ -703,6 +703,7 @@ FodyWeavers.xsd # https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore # by default all files in this directory should be ignored in Git +.vscode/* *devcontainer.env # these rules can be shared with collaborators @@ -721,6 +722,10 @@ FodyWeavers.xsd /.pnp .pnp.js +# generated during build +robots.txt +sitemap*.xml + # misc .DS_Store diff --git a/README.md b/README.md index 19a36e1..7796487 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Action Template -Yyarn Install composite action for yarn 3/4+ and "nodeLinker: node-modules" +Yarn Install composite action for yarn 3/4+ and "nodeLinker: node-modules" Reference: https://gist.github.com/belgattitude/042f9caf10d029badbde6cf9d43e400a