mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-17 20:51:21 +08:00
feat: add matlab.md
cheatsheet (#21). 02d0a495a6
This commit is contained in:
@ -233,14 +233,14 @@
|
||||
</span><span class="code-line"> <span class="token key atrule">name</span><span class="token punctuation">:</span> production_environment
|
||||
</span><span class="code-line"> <span class="token key atrule">url</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//github.com
|
||||
</span></code></pre>
|
||||
</div></div><div class="h3wrap-body"><h4 id="自定义环境变量"><a aria-hidden="true" tabindex="-1" href="#自定义环境变量"><span class="icon icon-link"></span></a>自定义环境变量</h4>
|
||||
<h4 id="自定义环境变量"><a aria-hidden="true" tabindex="-1" href="#自定义环境变量"><span class="icon icon-link"></span></a>自定义环境变量</h4>
|
||||
<p><code>GitHub</code> 会保留 <code>GITHUB_</code> 环境变量前缀供 <code>GitHub</code> 内部使用。设置有 <code>GITHUB_</code> 前缀的环境变量或密码将导致错误。</p>
|
||||
<pre class="language-yml"><code class="language-yml code-highlight"><span class="code-line"><span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> 测试 nodejs 获取环境变量
|
||||
</span><span class="code-line"> <span class="token key atrule">env</span><span class="token punctuation">:</span>
|
||||
</span><span class="code-line"> <span class="token key atrule">API_TOKEN</span><span class="token punctuation">:</span> $<span class="token punctuation">{</span><span class="token punctuation">{</span> secrets.API_TOKEN <span class="token punctuation">}</span><span class="token punctuation">}</span>
|
||||
</span></code></pre>
|
||||
<p>在 <code>https://github.com/<用户名>/<项目名称>/settings/secrets</code> 中添加 <code>secrets</code> <code>API_TOKEN</code>,在工作流中设置环境变量 <a href="https://github.com/jaywcjlove/github-actions/blob/799b232fca3d9df0272eaa12610f9ebfca51b288/.github/workflows/ci.yml#L46"><code>API_TOKEN</code></a></p>
|
||||
</div></div><div class="wrap h3body-exist"><div class="wrap-header h3wrap"><h3 id="表达式"><a aria-hidden="true" tabindex="-1" href="#表达式"><span class="icon icon-link"></span></a>表达式</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-exist"><div class="wrap-header h3wrap"><h3 id="表达式"><a aria-hidden="true" tabindex="-1" href="#表达式"><span class="icon icon-link"></span></a>表达式</h3><div class="wrap-body">
|
||||
<p>在 <code>if</code> 条件下使用表达式时,可以省略表达式语法 (<code>${{ }}</code>),因为 GitHub 会自动将 <code>if</code> 条件作为表达式求值</p>
|
||||
<pre class="language-yml"><code class="language-yml code-highlight"><span class="code-line"><span class="token key atrule">steps</span><span class="token punctuation">:</span>
|
||||
</span><span class="code-line"> <span class="token punctuation">-</span> <span class="token key atrule">uses</span><span class="token punctuation">:</span> actions/hello<span class="token punctuation">-</span>world<span class="token punctuation">-</span>action@v1.1
|
||||
@ -251,7 +251,7 @@
|
||||
<pre class="language-yml"><code class="language-yml code-highlight"><span class="code-line"><span class="token key atrule">env</span><span class="token punctuation">:</span>
|
||||
</span><span class="code-line"> <span class="token key atrule">MY_ENV_VAR</span><span class="token punctuation">:</span> $<span class="token punctuation">{</span><span class="token punctuation">{</span> <expression<span class="token punctuation">></span> <span class="token punctuation">}</span><span class="token punctuation">}</span>
|
||||
</span></code></pre>
|
||||
</div></div><div class="h3wrap-body"><h4 id="操作符"><a aria-hidden="true" tabindex="-1" href="#操作符"><span class="icon icon-link"></span></a>操作符</h4>
|
||||
<h4 id="操作符"><a aria-hidden="true" tabindex="-1" href="#操作符"><span class="icon icon-link"></span></a>操作符</h4>
|
||||
<ul class="cols-2 style-none">
|
||||
<li><code>( )</code> <em>(逻辑分组)</em></li>
|
||||
<li><code>[ ]</code> <em>(指数)</em></li>
|
||||
@ -267,7 +267,7 @@
|
||||
<li><code>||</code> <em>(或者)</em></li>
|
||||
</ul>
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
</div></div><div class="wrap h3body-not-exist col-span-2"><div class="wrap-header h3wrap"><h3 id="github-上下文"><a aria-hidden="true" tabindex="-1" href="#github-上下文"><span class="icon icon-link"></span></a>Github 上下文</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist col-span-2"><div class="wrap-header h3wrap"><h3 id="github-上下文"><a aria-hidden="true" tabindex="-1" href="#github-上下文"><span class="icon icon-link"></span></a>Github 上下文</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
|
||||
@ -814,7 +814,7 @@
|
||||
</span><span class="code-line highlight-line"> <span class="token key atrule">working-directory</span><span class="token punctuation">:</span> ./temp
|
||||
</span></code></pre>
|
||||
<p>使用 <code>working-directory</code> 关键字,您可以指定运行命令的工作目录(<code>./temp</code>)</p>
|
||||
</div></div><div class="h3wrap-body"><h4 id="defaultsrun"><a aria-hidden="true" tabindex="-1" href="#defaultsrun"><span class="icon icon-link"></span></a>defaults.run</h4>
|
||||
<h4 id="defaultsrun"><a aria-hidden="true" tabindex="-1" href="#defaultsrun"><span class="icon icon-link"></span></a>defaults.run</h4>
|
||||
<pre class="language-yml"><code class="language-yml code-highlight"><span class="code-line"><span class="token key atrule">jobs</span><span class="token punctuation">:</span>
|
||||
</span><span class="code-line"> <span class="token key atrule">job1</span><span class="token punctuation">:</span>
|
||||
</span><span class="code-line"> <span class="token key atrule">runs-on</span><span class="token punctuation">:</span> ubuntu<span class="token punctuation">-</span>latest
|
||||
@ -824,7 +824,7 @@
|
||||
</span><span class="code-line highlight-line"> <span class="token key atrule">working-directory</span><span class="token punctuation">:</span> scripts
|
||||
</span></code></pre>
|
||||
<p>作业中的所有 <code>run</code> 步骤提供默认的 <code>shell</code> 和 <code>working-directory</code></p>
|
||||
</div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="jobsjob_idstepsshell"><a aria-hidden="true" tabindex="-1" href="#jobsjob_idstepsshell"><span class="icon icon-link"></span></a>jobs.<job_id>.steps[*].shell</h3><div class="wrap-body">
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="jobsjob_idstepsshell"><a aria-hidden="true" tabindex="-1" href="#jobsjob_idstepsshell"><span class="icon icon-link"></span></a>jobs.<job_id>.steps[*].shell</h3><div class="wrap-body">
|
||||
<p>使用 <code>bash</code> 运行脚本</p>
|
||||
<pre class="language-yml"><code class="language-yml code-highlight"><span class="code-line"><span class="token key atrule">steps</span><span class="token punctuation">:</span>
|
||||
</span><span class="code-line"> <span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> Display the path
|
||||
@ -902,7 +902,7 @@
|
||||
<li><a href="https://jaywcjlove.github.io/github-actions">Github Actions 学习笔记</a> <em>(jaywcjlove.github.io)</em></li>
|
||||
<li><a href="https://docs.github.com/cn/actions/learn-github-actions">了解 GitHub Actions</a> <em>(docs.github.com)</em></li>
|
||||
</ul>
|
||||
</div></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang, All rights reserved.</footer></footer><script>
|
||||
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang, All rights reserved.</footer></footer><script>
|
||||
if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) {
|
||||
window.onhashchange = function () {
|
||||
anchorPoint()
|
||||
|
Reference in New Issue
Block a user