🌐 Detecting your location…

उन्नत GitHub क्रियाएँ 2026: पुन: प्रयोज्य वर्कफ़्लोज़, OIDC और डायनेमिक मैट्रिसेस

⏱️2 min read  ·  254 words
Advanced GitHub Actions 2026: Reusable Workflows, OIDC and Dynamic Matrices

बुनियादी सीआई से परे,GitHub क्रियाएँपुन: प्रयोज्य वर्कफ़्लो, समग्र क्रियाएँ, गतिशील मैट्रिक्स और OIDC प्रमाणीकरण का समर्थन करता है। यह गाइड 2026 में बड़े पैमाने पर इंजीनियरिंग टीमों द्वारा उपयोग किए जाने वाले उन्नत पैटर्न को कवर करता है।

पुन: प्रयोज्य कार्यप्रवाह

# .github/workflows/reusable-test.yml
on:
  workflow_call:
    inputs:
      python-version:
        required: true
        type: string
    secrets:
      codecov-token:
        required: true

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ inputs.python-version }}
      - run: pip install -r requirements.txt && pytest --cov

# Caller workflow
jobs:
  run-tests:
    uses: ./.github/workflows/reusable-test.yml
    with:
      python-version: '3.12'
    secrets:
      codecov-token: ${{ secrets.CODECOV_TOKEN }}

डायनामिक मैट्रिक्स (रनटाइम पर उत्पन्न)

jobs:
  generate-matrix:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.set-matrix.outputs.matrix }}
    steps:
      - uses: actions/checkout@v4
      - id: set-matrix
        run: |
          SERVICES=$(ls services/ | jq -R -s -c 'split("n")[:-1]')
          echo "matrix={"service":$SERVICES}" >> $GITHUB_OUTPUT

  build:
    needs: generate-matrix
    strategy:
      matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: docker build services/${{ matrix.service }}

ओआईडीसी प्रमाणीकरण (कोई दीर्घकालिक रहस्य नहीं)

क्लाउड क्रेडेंशियल के लिए अल्पकालिक GitHub टोकन का आदान-प्रदान करने के लिए OIDC का उपयोग करें। किसी संग्रहीत रहस्य की आवश्यकता नहीं है।

permissions:
  id-token: write
  contents: read

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Configure AWS (OIDC)
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::123456789:role/GitHubActionsRole
          aws-region: us-east-1
      - run: aws ecs update-service --cluster prod --service myapp --force-new-deployment

पर्यावरण संरक्षण नियम

jobs:
  staging:
    environment: staging
    runs-on: ubuntu-latest
    steps:
      - run: ./deploy.sh staging

  production:
    environment: production  # requires manual approval
    needs: staging
    runs-on: ubuntu-latest
    steps:
      - run: ./deploy.sh production

समग्र क्रियाएँ

# .github/actions/setup-project/action.yml
name: Setup Project
inputs:
  python-version:
    default: '3.12'
runs:
  using: composite
  steps:
    - uses: actions/setup-python@v5
      with:
        python-version: ${{ inputs.python-version }}
    - uses: actions/cache@v4
      with:
        path: ~/.cache/pip
        key: pip-${{ hashFiles('requirements.txt') }}
    - run: pip install -r requirements.txt
      shell: bash

निष्कर्ष

पुन: प्रयोज्य वर्कफ़्लोज़ रिपोज़ में दोहराव को समाप्त करते हैं। ओआईडीसी लंबे समय तक चलने वाले क्लाउड क्रेडेंशियल्स को रहस्य के रूप में संग्रहीत करने की आवश्यकता को हटा देता है। पर्यावरण संरक्षण नियम मानव अनुमोदन के पीछे उत्पादन तैनाती को बढ़ावा देते हैं। ये तीन पैटर्न 2026 में किसी भी इंजीनियरिंग टीम के लिए आवश्यक हैं।

MD Rafikul Islam

Written by

MD Rafikul Islam is a software developer and the editor of TechPulse. He writes about developer tooling, hardware, and the practical decisions that come up in day-to-day engineering work — which laptop to buy, which framework to commit to, why a build broke at 2am. He tests the tools he writes about and says plainly when something is not worth the money. Corrections and corrections requests are welcome at rony.yf25@gmail.com.

✍️ Leave a Comment

Your email address will not be published. Required fields are marked *

🌐 Read in:🇬🇧 English🇩🇪 Deutsch🇧🇷 Português🇸🇦 العربية🇮🇳 हिन्दी🇧🇩 বাংলা