From 4cc54604c9f8c6ebce7936a223b0e6fd0daea18e Mon Sep 17 00:00:00 2001
From: Gavin Didrichsen <gavin.didrichsen@gmail.com>
Date: Thu, 6 Mar 2025 08:11:49 +0000
Subject: [PATCH] ci(workflow): add Puppetcore gem sources validation

- Add reusable workflow for validating gem source configuration
- Configure proper authentication for private gem source
- Set up Ruby environment with caching optimizations
- Run gemfile_spec verification tests
- Support workflow dispatch with branch selection

This workflow follows the central repository pattern for CI resources
and implements the documented authentication pattern for Puppetcore gems.

Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
---
 .../validate-puppetcore-gem-sources.yml       | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 .github/workflows/validate-puppetcore-gem-sources.yml

diff --git a/.github/workflows/validate-puppetcore-gem-sources.yml b/.github/workflows/validate-puppetcore-gem-sources.yml
new file mode 100644
index 0000000..88de461
--- /dev/null
+++ b/.github/workflows/validate-puppetcore-gem-sources.yml
@@ -0,0 +1,38 @@
+name: Validate Puppetcore Gem Sources
+
+on:
+  workflow_dispatch:
+    inputs:
+      ref:
+        description: 'Branch, tag or SHA to checkout'
+        required: true
+        default: 'main'
+
+jobs:
+  verify-gemfile:
+    runs-on: ubuntu-latest
+    name: Verify Gemfile Dependencies
+    
+    env:
+      PUPPET_AUTH_TOKEN: ${{ secrets.PUPPET_AUTH_TOKEN }}
+      BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM: "forge-key:${{ secrets.PUPPET_AUTH_TOKEN }}"
+    
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.event.inputs.ref }}
+          
+      - name: Set up Ruby
+        uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: '3.2'
+          bundler-cache: true
+          cache-version: 0  # Helps manage cache versions explicitly
+          working-directory: .
+          
+      - name: Install dependencies
+        run: bundle install
+        
+      - name: Run Gemfile verification test
+        run: bundle exec rspec spec/support/gemfile_spec.rb --format documentation
-- 
GitLab