<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Özge Kavalcı on Medium]]></title>
        <description><![CDATA[Stories by Özge Kavalcı on Medium]]></description>
        <link>https://medium.com/@ariozgee?source=rss-d630a3473c5d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*08jQGNSmTWI2pMFPgYcx7Q.jpeg</url>
            <title>Stories by Özge Kavalcı on Medium</title>
            <link>https://medium.com/@ariozgee?source=rss-d630a3473c5d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:32:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ariozgee/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Implementing Custom Domain Name for Private REST API Using AWS CDK]]></title>
            <link>https://medium.com/@ariozgee/implementing-custom-domain-name-for-private-rest-api-using-aws-cdk-cb43fe9b7893?source=rss-d630a3473c5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb43fe9b7893</guid>
            <dc:creator><![CDATA[Özge Kavalcı]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 11:42:40 GMT</pubDate>
            <atom:updated>2025-01-06T11:42:40.268Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, AWS announced support for custom domain names for private REST APIs, a game-changing feature for organizations looking to streamline their internal API management.</p><p>In this blog post, I’ll walk you through how I implemented this solution using AWS CDK, allowing you to manage and deploy your infrastructure as code with all the benefits CDK provides. If you’re looking for an alternative to the CloudFormation approach highlighted in the <a href="https://aws.amazon.com/blogs/compute/implementing-custom-domain-names-for-private-endpoints-with-amazon-api-gateway/">official blog</a>, this is for you.</p><p><strong>Prerequisites</strong></p><p>Before diving in, make sure you have the following:</p><ul><li>AWS CDK installed.</li><li>Familiarity with TypeScript for development.</li><li>A VPC set up in your AWS account.</li><li>Hosted zones configured in Route 53.</li></ul><p><strong>Architecture Overview</strong></p><p>The solution involves creating the following resources:</p><ol><li>A private REST API in API Gateway.</li><li>Necessary VPC endpoint configuration.</li><li>Certificates for the custom domain name.</li><li>A custom domain name for the private API, including VPC endpoint associations.</li><li>An API mapping to associate the custom domain with the API.</li><li>A DNS Record for the private endpoint.</li></ol><p><strong>CDK Code Implementation</strong></p><p>I created the solution as a nested stack to make it reusable for modular development. The stack expects:</p><p>VPC Endpoint set up for the AWS Account:</p><pre>import { Construct } from &#39;constructs&#39;;<br>import { Vpc, InterfaceVpcEndpoint, InterfaceVpcEndpointAwsService, SecurityGroup, Port, Peer } from &#39;aws-cdk-lib/aws-ec2&#39;;<br><br>export class Network extends Construct {<br>    readonly VpcEndpoint: InterfaceVpcEndpoint;<br><br>    constructor(scope: Construct, id: string) {<br>        super(scope, id);<br><br>        const vpc = Vpc.fromLookup(this, &#39;Vpc&#39;, {<br>            vpcId: &#39;vpc-xxxxxxxxxxxxxxxxx&#39; // Replace with your VPC ID<br>        });<br><br>        const securityGroup = new SecurityGroup(this, &#39;ApiGatewayVpcEndpointSecurityGroup&#39;, {<br>            vpc: vpc<br>        });<br><br>        securityGroup.addIngressRule(Peer.anyIpv4(), Port.tcp(443));<br><br>        this.VpcEndpoint = new InterfaceVpcEndpoint(this, &#39;ApiGatewayVpcEndpoint&#39;, {<br>            service: InterfaceVpcEndpointAwsService.APIGATEWAY,<br>            vpc: vpc,<br>            securityGroups: [securityGroup],<br>            privateDnsEnabled: true<br>        });<br>    }<br>}</pre><p>Private API Gateway REST API:</p><pre>import { Construct } from &#39;constructs&#39;;<br>import { IFunction } from &#39;aws-cdk-lib/aws-lambda&#39;;<br>import { InterfaceVpcEndpoint } from &#39;aws-cdk-lib/aws-ec2&#39;;<br>import { NestedStack, NestedStackProps, Aws } from &#39;aws-cdk-lib&#39;;<br>import { PolicyDocument, PolicyStatement, AnyPrincipal, Effect } from &#39;aws-cdk-lib/aws-iam&#39;;<br>import { RestApi, LambdaIntegration, UsagePlan, ApiKey, EndpointType } from &#39;aws-cdk-lib/aws-apigateway&#39;;<br><br>export interface IPrivateRestApiProps extends NestedStackProps {<br>    readonly VpcEndpoint: InterfaceVpcEndpoint;<br>    readonly Lambda: IFunction;<br>}<br><br>export class PrivateRestApi extends NestedStack {<br>    readonly PrivateRestApi: RestApi;<br><br>    constructor(scope: Construct, id: string, props: IPrivateRestApiProps) {<br>        super(scope, id, props);<br><br>        const apiLambdaIntegration = new LambdaIntegration(props.Lambda);<br><br>        this.PrivateRestApi = new RestApi(this, `${id}PrivateRestApi`, {<br>            restApiName: `${id} Private Rest API`,<br>            endpointConfiguration: {<br>                types: [EndpointType.PRIVATE],<br>                vpcEndpoints: [props.VpcEndpoint]<br>            },<br>            disableExecuteApiEndpoint: true,<br>            policy: new PolicyDocument({<br>                statements: [<br>                    new PolicyStatement({<br>                        effect: Effect.ALLOW,<br>                        principals: [new AnyPrincipal()],<br>                        actions: [&#39;execute-api:Invoke&#39;],<br>                        resources: [`arn:aws:execute-api:${Aws.REGION}:${Aws.ACCOUNT_ID}:*/*`],<br>                        conditions: {<br>                            StringEquals: {<br>                                &#39;aws:SourceVpce&#39;: props.VpcEndpoint.vpcEndpointId<br>                            }<br>                        }<br>                    })<br>                ]<br>            })<br>        });<br><br>        const apiKey = new ApiKey(this, `${id}ApiKey`, {<br>            apiKeyName: `${id}ApiKey`<br>        });<br><br>        const usagePlan = new UsagePlan(this, `${id}UsagePlan`, {<br>            apiStages: [<br>                {<br>                    stage: this.PrivateRestApi.deploymentStage<br>                }<br>            ],<br>            throttle: {<br>                burstLimit: 1500,<br>                rateLimit: 1000<br>            }<br>        });<br><br>        usagePlan.addApiKey(apiKey);<br><br>        const apiPath = this.PrivateRestApi.root.addResource(&#39;v1&#39;);<br><br>        apiPath.addMethod(&#39;GET&#39;, apiLambdaIntegration, {<br>            apiKeyRequired: true<br>        });<br>    }<br>}</pre><p>The PrivateCustomDomain stack can be used across multiple projects. Here is the CDK implementation for setting up custom domain names for private REST APIs. Since there is no available L2 construct in AWS CDK for some of these configurations (e.g., API Gateway domain names and associations), I used the L1 constructs (CfnDomainNameV2, CfnBasePathMappingV2, CfnDomainNameAccessAssociation) to implement this solution:</p><pre>import { Construct } from &#39;constructs&#39;;<br>import { Effect } from &#39;aws-cdk-lib/aws-iam&#39;;<br>import { InterfaceVpcEndpoint } from &#39;aws-cdk-lib/aws-ec2&#39;;<br>import { NestedStack, NestedStackProps, Fn } from &#39;aws-cdk-lib&#39;;<br>import { IHostedZone, CfnRecordSet, RecordType } from &#39;aws-cdk-lib/aws-route53&#39;;<br>import { Certificate, CertificateValidation } from &#39;aws-cdk-lib/aws-certificatemanager&#39;;<br>import { IRestApi, CfnDomainNameV2, CfnBasePathMappingV2, CfnDomainNameAccessAssociation, EndpointType, SecurityPolicy } from &#39;aws-cdk-lib/aws-apigateway&#39;;<br><br>export interface PrivateCustomDomainProps extends NestedStackProps {<br>    readonly VpcEndpoint: InterfaceVpcEndpoint;<br>    readonly PublicHostedZone: IHostedZone;<br>    readonly PrivateHostedZone: IHostedZone;<br>    readonly PrivateRestApi: IRestApi;<br>    readonly DomainNamePrefix: string;<br>}<br><br>export class PrivateCustomDomain extends NestedStack {<br>    constructor(scope: Construct, id: string, props: PrivateCustomDomainProps) {<br>        super(scope, id, props);<br><br>        const primaryDnsEntry = Fn.select(0, props.VpcEndpoint.vpcEndpointDnsEntries);<br>        const entryParts = Fn.split(&#39;:&#39;, primaryDnsEntry);<br>        const vpcEndpointHostedZoneId = Fn.select(0, entryParts);<br>        const vpcEndpointPrimaryDnsName = Fn.select(1, entryParts);<br><br>        const customDomainName = props.DomainNamePrefix + &#39;.&#39; + props.PrivateHostedZone.zoneName;<br><br>        const customDomainPublicCertificate = new Certificate(this, `${id}PublicCertificate`, {<br>            domainName: customDomainName,<br>            validation: CertificateValidation.fromDns(props.PublicHostedZone)<br>        });<br><br>        const customDomainPrivateCertificate = new Certificate(this, `${id}PrivateCertificate`, {<br>            domainName: customDomainName,<br>            validation: CertificateValidation.fromDns(props.PrivateHostedZone)<br>        });<br><br>        const customDomain = new CfnDomainNameV2(this, `${id}PrivateCustomDomain`, {<br>            domainName: customDomainName,<br>            certificateArn: customDomainPrivateCertificate.certificateArn,<br>            endpointConfiguration: {<br>                types: [EndpointType.PRIVATE.toString()]<br>            },<br>            securityPolicy: SecurityPolicy.TLS_1_2.toString(),<br>            policy: JSON.stringify({<br>                Statement: [<br>                    {<br>                        Effect: Effect.DENY.toString(),<br>                        Principal: &#39;*&#39;,<br>                        Action: &#39;execute-api:Invoke&#39;,<br>                        Resource: [&#39;execute-api:/*&#39;],<br>                        Condition: {<br>                            StringNotEquals: {<br>                                &#39;aws:SourceVpce&#39;: props.VpcEndpoint.vpcEndpointId<br>                            }<br>                        }<br>                    },<br>                    {<br>                        Effect: Effect.ALLOW.toString(),<br>                        Principal: &#39;*&#39;,<br>                        Action: &#39;execute-api:Invoke&#39;,<br>                        Resource: [&#39;execute-api:/*&#39;]<br>                    }<br>                ]<br>            })<br>        });<br><br>        const apiMapping = new CfnBasePathMappingV2(this, `${id}PrivateApiMapping`, {<br>            restApiId: props.PrivateRestApi.restApiId,<br>            stage: props.PrivateRestApi.deploymentStage.stageName,<br>            domainNameArn: customDomain.ref,<br>            basePath: props.PrivateRestApi.deploymentStage.stageName<br>        });<br><br>        const privateApiRecord = new CfnRecordSet(this, `${id}PrivateApiRecord`, {<br>            hostedZoneId: props.PrivateHostedZone.hostedZoneId,<br>            name: customDomainName,<br>            type: RecordType.A.toString(),<br>            aliasTarget: {<br>                dnsName: vpcEndpointPrimaryDnsName,<br>                hostedZoneId: vpcEndpointHostedZoneId<br>            }<br>        });<br><br>        const customDomainAccessAssociation = new CfnDomainNameAccessAssociation(this, `${id}DomainNameAccessAssociation`, {<br>            accessAssociationSource: props.VpcEndpoint.vpcEndpointId,<br>            accessAssociationSourceType: &#39;VPCE&#39;,<br>            domainNameArn: customDomain.ref<br>        });<br><br>        apiMapping.node.addDependency(customDomain);<br>        privateApiRecord.node.addDependency(customDomain);<br>        customDomainAccessAssociation.node.addDependency(customDomain);<br>    }<br>}</pre><p><strong>Key Features</strong></p><ol><li><strong>Access Control Policies</strong>: Deny unauthorized traffic and restrict access to specific VPC endpoints.</li><li><strong>Certificates for Validation</strong>: Public and private certificates enable secure communication and internal validation.</li><li><strong>Custom Domain Associations</strong>: Associate custom domains with the private REST API.</li><li><strong>Route 53 Integration</strong>: DNS records ensure seamless resolution for internal APIs.</li></ol><p><strong>Conclusion</strong></p><p>Implementing custom domain names for private REST APIs using AWS CDK simplifies infrastructure management while providing the flexibility to define advanced configurations. This approach offers a scalable, secure, and maintainable solution for internal API use cases. I hope this guide inspires you to leverage AWS CDK for your private REST API needs.</p><p>Let me know if you have any questions or feedback about this implementation! 🙋‍♀️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb43fe9b7893" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Integrate GitHub Workflows into Your Project]]></title>
            <link>https://medium.com/postnl-engineering/how-to-integrate-github-workflows-into-your-project-36a568ab0326?source=rss-d630a3473c5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/36a568ab0326</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Özge Kavalcı]]></dc:creator>
            <pubDate>Wed, 05 Jul 2023 10:54:25 GMT</pubDate>
            <atom:updated>2023-07-05T10:56:00.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaLMtV42eaM17-Sozal1HQ.png" /><figcaption>Image made by the author — GitHub Workflow</figcaption></figure><p>Your source code repository is hosted on GitHub and now you’d like to learn how to automate processes for developing, testing, building, and release of your software. Then you’ve come to the correct post! Let’s begin.</p><p>GitHub provides many functionalities that make your life easier as a developer and I think you should take advantage of these benefits.</p><p>In this post, I’ll explain what GitHub Actions are, what they do, and how you can integrate them into your workflow to automate repeated tasks.</p><p>End of this post, We’ll be ready to set up a Workflow with GitHub Actions.</p><p>We will go one step further and create a Reusable Workflow to use by each repository in your organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XMN-joybNy886wbXheaeBw.png" /><figcaption>Image made by the author — CI/CD Pipeline</figcaption></figure><h3>Actions vs. Workflows: Understanding the Difference</h3><p>Actions are the portable building block used to perform complex tasks that you may call multiple times. They are called inside a job as a step. You’ll see more detail about “what a job is” in the continuation of the post. By using an action, you can reduce the amount of repetitive code needed to write a workflow. You can create your actions or you can reuse open-source actions from the <a href="https://github.com/marketplace?type=actions">GitHub Marketplace</a>. Here are some example actions; building an npm package, publishing an npm package to an artifactory, and scanning an npm package to find out if there is any vulnerability.</p><blockquote>Little tip; Many of the functionality we might want to implement into our workflow is probably already published by someone else as an action, so take a look at to GitHub Marketplace before reinventing the wheel. In addition, it is always possible to modify existing actions.</blockquote><p>On the other hand, Workflows are a collection of job definitions that get executed when they are triggered by an event. Workflows can also be triggered manually by the user. The clear answer for the difference between an Action and a Workflow is, Actions are used as a step in jobs inside workflows.</p><p>A repository can have multiple workflows, as well as a workflow can be re-used by multiple repositories. For example, one workflow can build and test your application when a new pull request is created, while another workflow can deploy your application when a new release is created. And if you have multiple repositories they can re-use the same workflow for their CI/CD process. They are called Reusable Workflows and that’s the topic we are going to go deeper in this post.</p><p>Before we dive deep into the workflows, I’d like to explain a bit about the components that we’ll use a lot in this post;</p><p><strong>Acomposite action</strong> is one of the types of custom GitHub Actions that can be created. A composite action bundles multiple steps into a single action but is presented as one step when it is invoked inside a workflow. For example, building and publishing an npm package can be combined into one Composite Action and run sequentially. They can be handy to divide large jobs into multiple files. Composite action is stored in a different file than the reusable workflow.</p><blockquote>Little warning; If your repositories belongs to a private organization then you may need to create an ssh key and share it with the other repositories wants to checkout composite action during workflow run. Because private repositories are not publicly accessible. <a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">Here</a> you can find how you can create an ssh key for your repository. You can find example usages of both (with and without an ssh key) in the following topic. If it’s an internal repository then you don’t need to checkout the composite action, you can call it directly.</blockquote><p>Another important thing is Reusable Workflows can use secrets by inheriting them from a repository while Composite Actions cannot. You need to pass each secret via input parameters.</p><p><strong>An event</strong> can be anything that can happen on a GitHub repository.<strong> </strong>For example, pushing a code, opening a pull request, or creating a release. You can check the list of events <a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#webhook-events">here</a>.</p><p><strong>A job</strong> is a series of steps that gets executed inside a workflow based on the trigger conditions. Each step is either a script or a GitHub Action. The steps under the job are run sequentially but the jobs run in parallel by default. To run the jobs sequentially, you need to define dependencies between them. Each job runs separately by a specific runner which will report the results of the job back to GitHub. And the results can be checked directly from the Github UI.</p><p><strong>A matrix</strong> is a strategy to run multiple jobs that has the same job definition with different parameters. When you create a job definition with a matrix strategy, it will automatically create multiple runs with the same job based on the combinations of the parameters defined by the user. For example, you can build and publish multiple npm packages under one repository based on the directory of the package.json file or you can build your project in multiple node versions. <a href="https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs">Here</a> you can find what kind of combination you can use for the matrix.</p><p>It’s time to see how you can use Reusable Workflows and Composite Actions in your project!</p><h3>Reusable Workflows: How to Implement and Utilize Them</h3><p>Workflows are written in YAML syntax and are stored in .github/workflows directory at the root of the repository. The difference in Reusable Workflows is they need to be located in a different repository than your applications located so they can be called by multiple repositories.</p><p>Rather than copying and pasting from one workflow to another, you can make workflows reusable to avoid duplication. Your organization can build up a library of reusable workflows that can be centrally maintained.</p><p>The only thing you need to check is if your repositories belong to a private organization then you need to update the access permissions of your reusable workflows repository settings to share them within the organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*EVZPwG6KIQXyF2JC3vJPwQ.png" /><figcaption>Settings of the repository where reusable workflows are located</figcaption></figure><p>There are some keywords in the syntax of a workflow you should get familiar with. <a href="https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions">Here</a> you can find the full syntax.</p><p>Now we’ll see how Reusable Workflows and Actions work together. We’ll create one workflow for the repository where your application is located and one workflow for a reusable one. I have added comments for the steps in both files. Don’t worry we’ll deep dive into composite actions that we used in those examples in the upcoming topic.</p><p><em>Application workflow under .github/workflows/ directory in the Application Repository</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fe01d102785fca23ad22d856476565c/href">https://medium.com/media/6fe01d102785fca23ad22d856476565c/href</a></iframe><p><em>Reusable workflow under .github/workflows/ directory in the Reusable Workflows Repository</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0da9d66fed8a2caeb80c2a24605a68c/href">https://medium.com/media/d0da9d66fed8a2caeb80c2a24605a68c/href</a></iframe><h3>Useful Tips for Workflows &amp; Actions👌</h3><p>The environment variables that you defined at the beginning of the workflow can not be usable at the job condition level. But they are reachable at the step condition level. If you would like to use them in “job.if” level then you need to create an output in the previous job and use it in the next one. In this example, you can see both “step.if” and “job.if” level context availability.</p><p>In GitHub documentation, you can see all the context availability <a href="https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability">here</a>.</p><pre>env:<br>  DEPLOY: ${{ github.event_name == &#39;pull_request&#39; &amp;&amp; github.event.action != &#39;closed&#39; }}<br><br>jobs:<br>  init:<br>    name: Init<br>    runs-on: ubuntu-latest<br>    outputs:<br>      DEPLOY: ${{ steps.setvars.outputs.DEPLOY }}<br>    steps:<br>      - name: Checkout Source Code<br>        uses: actions/checkout@v3<br><br>      - name: Set Environmet Variables<br>        id: setvars<br>        run: |<br>          if [[ &quot;${{ github.event_name }}&quot; == &quot;pull_request&quot; &amp;&amp; <br>                &quot;${{ github.event.action }}&quot; != &quot;closed&quot; ]];<br>          then<br>            echo &quot;DEPLOY=true&quot; &gt;&gt; $GITHUB_OUTPUT<br>          fi<br><br>deploy:<br>    name: Build &amp; Deploy CDK<br>    needs: <br>      - init<br>    if: needs.init.outputs.DEPLOY<br>    runs-on: ubuntu-latest<br>    steps:<br>      .<br>      .<br>      .<br>      - name: Deploy<br>        if: ${{ env.DEPLOY == &#39;true&#39; }}<br>        working-directory: ${{ env.WORKING_DIRECTORY_DEPLOY }}<br>        run: |<br>          npx npm-assets .<br>          npx cdk deploy --context config=local --require-approval=never</pre><p>When you create a dependency with the “need” keyword you have to wait for the job you specified under the keyword but the result of the job doesn’t need to be successful. You can run the next step in any case. Or you can add more conditions for each result of the step.</p><pre>    needs: <br>      - init<br>      - unit-tests<br>      - build-nuget<br>    if: |<br>      always() &amp;&amp;<br>      needs.init.result == &#39;success&#39; &amp;&amp;<br>      (needs.unit-tests.result == &#39;success&#39; || needs.unit-tests.result == &#39;skipped&#39;) &amp;&amp; <br>      (needs.build-nuget.result == &#39;success&#39; || needs.build-nuget.result == &#39;skipped&#39;)</pre><p>Or</p><pre>    needs: <br>      - init<br>      - unit-tests<br>      - build-nuget<br>    if: |<br>      always() &amp;&amp;<br>      !contains(needs.*.result, &#39;failure&#39;) &amp;&amp;<br>      !contains(needs.*.result, &#39;cancelled&#39;)</pre><p>You can use the outputs of a job as an environment variable for another job. I prefer this approach if the output of the previous job is going to use only one specific job.</p><pre>    # In this example shows that IMAGE_VERSION and IMAGE_PATH<br>    # variables set by init job. build-docker job wants to use it<br>    # as an environment variable. Instead of using long and <br>    # complicated format like ${{ needs.init.outputs.IMAGE_VERSION }}<br>    # you can add those as a job environment variable and<br>    # you can use more clear variable names inside the steps.<br>    build-docker:<br>     name: Build Docker Image<br>     needs: <br>        - init<br>      - unit-tests<br>    if: inputs.DOCKER_PROJECT_NAME<br>    defaults:<br>      run:<br>        working-directory: ${{ env.WORKING_DIRECTORY_NUGET }}<br>    env:<br>      ARTIFACTORY_SECRET: ${{ secrets.ARTIFACTORY_KEYS }}<br>      IMAGE_VERSION: ${{ needs.init.outputs.IMAGE_VERSION }}<br>      IMAGE_PATH: ${{ needs.init.outputs.IMAGE_PATH }}<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Checkout Source Code<br>        uses: actions/checkout@v3<br><br>      - name: Authenticate Artifactory for Docker<br>        run: |<br>          USERNAME=$(jq -r &#39;.username&#39; &lt;&lt;&lt; &quot;$ARTIFACTORY_SECRET&quot;)<br>          API_KEY=$(jq -r &#39;.apiKey&#39; &lt;&lt;&lt; &quot;$ARTIFACTORY_SECRET&quot;)<br>          echo $API_KEY | docker login --username $USERNAME --password-stdin sample.artifactory.io<br><br>      - name: Build image<br>        run: |<br>          docker build -f ${{ inputs.DOCKER_PROJECT_NAME }}/Dockerfile \<br>          --build-arg &quot;NUGET_REPO=${{ env.ARTIFACTORY_NUGET_URL }}&quot; \<br>          --build-arg &quot;NUGET_USERNAME=$(echo $ARTIFACTORY_SECRET | jq -r .username)&quot; \<br>          --build-arg &quot;NUGET_PASSWORD=$(echo $ARTIFACTORY_SECRET | jq -r .apiKey)&quot; \<br>          --tag &quot;$IMAGE_PATH:$IMAGE_VERSION&quot; .<br><br>      - name: Push Image<br>        run: docker push &quot;$IMAGE_PATH:$IMAGE_VERSION&quot;</pre><p>And last, here’s a list of some actions created by the community that I’m using in my pipelines.</p><p><a href="https://github.com/alexcasalboni/aws-lambda-power-tuning">alexcasalboni/aws-lambda-power-tuning</a>: <em>Using to optimize our Lambda functions for cost and performance way.</em></p><p><a href="https://github.com/thollander/actions-comment-pull-request">thollander/actions-comment-pull-request:</a> <em>Using for adding the lambda power tuner results directly to the Pull Request as a comment.</em></p><p><a href="https://github.com/microsoft/variable-substitution">microsoft/variable-substitution:</a> <em>Using for updating variables in JSON file inside the repository during the workflow run.</em></p><p><a href="https://github.com/dorny/test-reporter">dorny/test-reporter:</a> <em>Using for generating .Net Unit Test results as a report directly to the workflow run.</em></p><h3>Composite Actions: How to Implement and Utilize Them</h3><p>You already know how you can call an action inside a workflow from the previous topic. Now we are going to use actions provided by GitHub, the GitHub community, and the organization we are in.</p><p><em>composite action under prep-npm/ directory in the Reusable Workflows Repository</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dab42262df7cf3b7fc1228cd5212544f/href">https://medium.com/media/dab42262df7cf3b7fc1228cd5212544f/href</a></iframe><p><em>composite action under unit-tests/ directory in the Reusable Workflows Repository</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37fd617af22e693c0c05ecacc34e0737/href">https://medium.com/media/37fd617af22e693c0c05ecacc34e0737/href</a></iframe><h3>Action Secrets: Passing them to Workflows</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*pWLKdbfwyDDL5_f2h_EKWw.png" /><figcaption>Actions Secrets are located under Settings of the Repository</figcaption></figure><p>There are 3 types of secrets: Repository Secrets, Environment Secrets, and Organization Secrets. There are also tiers within the Secrets such as Actions, <a href="https://docs.github.com/en/rest/dependabot/secrets">Dependabot</a>, and <a href="https://docs.github.com/en/rest/codespaces/secrets">Codespaces</a>. Organization Secrets are created by the organization automatically when you create a repository under this organization. You can specify which repositories these organization secrets are shared. Repository Secrets and Environment Secrets are mostly added by the developer. I definitely recommend adding your hidden values like Api Keys, Tokens, etc to the Action Secrets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*BDYcGbPU5iPgNwlqM1e0Bg.png" /><figcaption>Environment Secrets</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*rO-1fYNkS42OHSZKaaeeHA.png" /><figcaption>Repository Secrets</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sUVJtHMcjG2lR-OrOwZaQ.png" /><figcaption>Organization Secrets</figcaption></figure><p>When you are calling a reusable workflow if you add the “inherit” keyword then all the secrets in the application repository will be inherited to reusable workflow during the workflow run.</p><pre><br>jobs:<br>  call-workflow:<br>    uses: Sample-Organization/reusable-workflows/.github/workflows/build.yml@master<br>    with:<br>      SOLUTION_NAMES: &#39;[&quot;Solution1&quot;, &quot;Solution2&quot;, &quot;Solution3&quot;]&#39;<br>    secrets: inherit</pre><p>Inside reusable workflow, you need to define which secret you want to inherit by.</p><pre>on:<br>  workflow_call:<br>    inputs:<br>      SOLUTION_NAMES:<br>        required: false <br>        type: string<br>    secrets:<br>      REUSABLE_REPOSITORY_SSH:<br>        required: true <br>      ARTIFACTORY_KEYS:<br>        required: true<br>      SONAR_TOKEN:<br>        required: true</pre><h3><strong>Thank you for bearing with me till the end 🙋</strong></h3><p>I hope you found the Reusable Workflows and GitHub Actions useful and that you’re ready to integrate them into your projects. The workflows that I shared in this post are just simple examples of how you can use them. There are a lot of other use cases and benefits to it. I strongly recommend you read the full <a href="https://docs.github.com/en/actions/using-workflows/reusing-workflows">GitHub documentation</a> on it and experiment with how you can apply it to your use case.</p><p>By the way, I’m really curious about the useful actions or tips you found, feel free to share with me in the comments.</p><p>Happy gitting! 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36a568ab0326" width="1" height="1" alt=""><hr><p><a href="https://medium.com/postnl-engineering/how-to-integrate-github-workflows-into-your-project-36a568ab0326">How to Integrate GitHub Workflows into Your Project</a> was originally published in <a href="https://medium.com/postnl-engineering">PostNL Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>